add yet another pointer warp option: disable all warps

ticket #asdfuser


SVN revision: 83629
This commit is contained in:
Mike Blumenkrantz 2013-02-05 13:33:49 +00:00
parent 41759238cd
commit ec87e69908
7 changed files with 55 additions and 28 deletions

View File

@ -2156,13 +2156,15 @@ e_border_focus_set_with_pointer(E_Border *bd)
if (e_config->focus_policy == E_FOCUS_SLOPPY)
{
E_Border *pbd;
int ret = 0;
pbd = e_border_under_pointer_get(bd->desk, bd);
if (pbd && (pbd != bd)) e_border_pointer_warp_to_center(bd);
else e_border_focus_set(bd, 1, 0);
if (pbd && (pbd != bd)) ret = e_border_pointer_warp_to_center(bd);
if (!ret) e_border_focus_set(bd, 1, 0);
}
else
{
e_border_pointer_warp_to_center(bd);
if (!e_border_pointer_warp_to_center(bd))
e_border_focus_set(bd, 1, 0);
}
}
@ -4495,25 +4497,28 @@ _e_border_reset_lost_window(E_Border *bd)
if (bd->iconic) e_border_uniconify(bd);
if (!bd->moving) e_border_center(bd);
e_zone_useful_geometry_get(bd->zone, &x, &y, &w, &h);
ecore_x_pointer_xy_get(bd->zone->container->win, &warp_x[0], &warp_y[0]);
warp_to_x = x + ((w / 2) - (bd->w / 2)) + (warp_x[0] - bd->x);
warp_to_y = y + ((h / 2) - (bd->h / 2)) + (warp_y[0] - bd->y);
warp_to = 1;
warp_to_win = bd->zone->container->win;
if (warp_timer) ecore_timer_del(warp_timer);
warp_timer = ecore_timer_add(0.01, _e_border_pointer_warp_to_center_timer, bd);
e_border_raise(bd);
if (!bd->lock_focus_out)
e_border_focus_set(bd, 1, 1);
if (!e_config->disable_all_pointer_warps)
{
e_zone_useful_geometry_get(bd->zone, &x, &y, &w, &h);
ecore_x_pointer_xy_get(bd->zone->container->win, &warp_x[0], &warp_y[0]);
warp_to_x = x + ((w / 2) - (bd->w / 2)) + (warp_x[0] - bd->x);
warp_to_y = y + ((h / 2) - (bd->h / 2)) + (warp_y[0] - bd->y);
warp_to = 1;
warp_to_win = bd->zone->container->win;
if (warp_timer) ecore_timer_del(warp_timer);
warp_timer = ecore_timer_add(0.01, _e_border_pointer_warp_to_center_timer, bd);
e_border_focus_lock_set(EINA_TRUE);
warp_timer_border = bd;
}
bd->during_lost = EINA_FALSE;
e_border_focus_lock_set(EINA_TRUE);
warp_timer_border = bd;
}
EAPI void
@ -10239,6 +10244,7 @@ e_border_pointer_warp_to_center(E_Border *bd)
/* Do not slide pointer when disabled (probably breaks focus
* on sloppy/mouse focus but requested by users). */
if (!e_config->pointer_slide) return 0;
if (e_config->disable_all_pointer_warps) return 0;
/* Only warp the pointer if it is not already in the area of
* the given border */
ecore_x_pointer_xy_get(bd->zone->container->win, &x, &y);

View File

@ -630,6 +630,7 @@ _e_config_edd_init(Eina_Bool old)
E_CONFIG_VAL(D, T, focus_last_focused_per_desktop, INT); /**/
E_CONFIG_VAL(D, T, focus_revert_on_hide_or_close, INT); /**/
E_CONFIG_VAL(D, T, pointer_slide, INT); /**/
E_CONFIG_VAL(D, T, disable_all_pointer_warps, INT); /**/
E_CONFIG_VAL(D, T, use_e_cursor, INT); /**/
E_CONFIG_VAL(D, T, cursor_size, INT); /**/
E_CONFIG_VAL(D, T, menu_autoscroll_margin, INT); /**/
@ -1329,6 +1330,7 @@ e_config_load(void)
E_CONFIG_LIMIT(e_config->focus_last_focused_per_desktop, 0, 1);
E_CONFIG_LIMIT(e_config->focus_revert_on_hide_or_close, 0, 1);
E_CONFIG_LIMIT(e_config->pointer_slide, 0, 1);
E_CONFIG_LIMIT(e_config->disable_all_pointer_warps, 0, 1);
E_CONFIG_LIMIT(e_config->show_cursor, 0, 1);
E_CONFIG_LIMIT(e_config->use_e_cursor, 0, 1);
E_CONFIG_LIMIT(e_config->cursor_size, 0, 1024);

View File

@ -48,7 +48,7 @@ typedef enum
/* increment this whenever a new set of config values are added but the users
* config doesn't need to be wiped - simply new values need to be put in
*/
#define E_CONFIG_FILE_GENERATION 8
#define E_CONFIG_FILE_GENERATION 9
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH * 1000000) + E_CONFIG_FILE_GENERATION)
#define E_CONFIG_BINDINGS_VERSION 0 // DO NOT INCREMENT UNLESS YOU WANT TO WIPE ALL BINDINGS!!!!!
@ -168,6 +168,7 @@ struct _E_Config
int resize_info_visible; // GUI
int focus_last_focused_per_desktop; // GUI
int focus_revert_on_hide_or_close; // GUI
int disable_all_pointer_warps; // GUI
int pointer_slide; // GUI
int use_e_cursor; // GUI
int cursor_size; // GUI

View File

@ -1579,6 +1579,7 @@ e_configure_option_init(void)
OPT_ADD(BOOL, focus_last_focused_per_desktop, _("Revert window focus on desk switch"), _("border"), _("focus"), _("vdesk"));
OPT_ADD(BOOL, focus_revert_on_hide_or_close, _("Revert window focus on window hide or close"), _("border"), _("focus"));
OPT_ADD(BOOL, pointer_slide, _("Warp pointer to new windows and away from closed windows"), _("border"), _("focus"), _("warp"), _("pointer"));
OPT_ADD(BOOL, disable_all_pointer_warps, _("Prevent all forms of pointer warping"), _("border"), _("focus"), _("warp"), _("pointer"));
OPT_ADD(BOOL, border_raise_on_mouse_action, _("Windows raise on mouse move/resize"), _("border"), _("raise"), _("focus"), _("mouse"), _("pointer"), _("move"), _("resize"));
OPT_ADD(BOOL, border_raise_on_focus, _("Windows raise when focused"), _("border"), _("raise"), _("focus"), _("mouse"));

View File

@ -28,6 +28,7 @@ struct _E_Config_Dialog_Data
int focus_last_focused_per_desktop;
int focus_revert_on_hide_or_close;
int pointer_slide;
int disable_all_pointer_warps;
double auto_raise_delay;
int border_raise_on_mouse_action;
int border_raise_on_focus;
@ -77,6 +78,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->focus_revert_on_hide_or_close =
e_config->focus_revert_on_hide_or_close;
cfdata->pointer_slide = e_config->pointer_slide;
cfdata->disable_all_pointer_warps = e_config->disable_all_pointer_warps;
cfdata->mode = cfdata->focus_policy;
@ -127,6 +129,7 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
e_config->focus_last_focused_per_desktop = 1;
e_config->focus_revert_on_hide_or_close = 1;
e_config->pointer_slide = 0;
e_config->disable_all_pointer_warps = 1;
}
else if (cfdata->mode == E_FOCUS_MOUSE)
{
@ -139,6 +142,7 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
e_config->focus_last_focused_per_desktop = 0;
e_config->focus_revert_on_hide_or_close = 0;
e_config->pointer_slide = 1;
e_config->disable_all_pointer_warps = 0;
}
else
{
@ -151,6 +155,7 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
e_config->focus_last_focused_per_desktop = 1;
e_config->focus_revert_on_hide_or_close = 1;
e_config->pointer_slide = 1;
e_config->disable_all_pointer_warps = 0;
}
e_config->use_auto_raise = cfdata->use_auto_raise;
e_border_button_bindings_grab_all();
@ -181,6 +186,7 @@ _advanced_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
e_config->focus_revert_on_hide_or_close =
cfdata->focus_revert_on_hide_or_close;
e_config->pointer_slide = cfdata->pointer_slide;
e_config->disable_all_pointer_warps = cfdata->disable_all_pointer_warps;
e_config->use_auto_raise = cfdata->use_auto_raise;
e_config->auto_raise_delay = cfdata->auto_raise_delay;
@ -204,6 +210,7 @@ _advanced_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *c
(e_config->focus_last_focused_per_desktop != cfdata->focus_last_focused_per_desktop) ||
(e_config->focus_revert_on_hide_or_close != cfdata->focus_revert_on_hide_or_close) ||
(e_config->pointer_slide != cfdata->pointer_slide) ||
(e_config->disable_all_pointer_warps != cfdata->disable_all_pointer_warps) ||
(e_config->use_auto_raise != cfdata->use_auto_raise) ||
(e_config->auto_raise_delay != cfdata->auto_raise_delay) ||
(e_config->border_raise_on_mouse_action != cfdata->border_raise_on_mouse_action) ||
@ -344,6 +351,10 @@ _advanced_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Da
ob = e_widget_check_add(evas, _("Slide pointer to a new window which is focused"),
&(cfdata->pointer_slide));
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Prevent all forms of pointer warping"),
&(cfdata->disable_all_pointer_warps));
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(ol, of, 1, 0, 0.5);
e_widget_toolbook_page_append(otb, NULL, _("Miscellaneous"), ol,
1, 0, 1, 0, 0.5, 0.0);

View File

@ -481,9 +481,10 @@ e_winlist_left(E_Zone *zone)
if (!bd_orig->lock_focus_out)
e_border_focus_set(bd_orig, 0, 0);
if ((e_config->focus_policy != E_FOCUS_CLICK) ||
if ((!e_config->disable_all_pointer_warps) &&
((e_config->focus_policy != E_FOCUS_CLICK) ||
(e_config->winlist_warp_at_end) ||
(e_config->winlist_warp_while_selecting))
(e_config->winlist_warp_while_selecting)))
{
_warp_to_x = _bd_next->x + (_bd_next->w / 2);
if (_warp_to_x < (_bd_next->zone->x + 1))
@ -605,9 +606,10 @@ e_winlist_down(E_Zone *zone)
if (!bd_orig->lock_focus_out)
e_border_focus_set(bd_orig, 0, 0);
if ((e_config->focus_policy != E_FOCUS_CLICK) ||
if ((!e_config->disable_all_pointer_warps) &&
((e_config->focus_policy != E_FOCUS_CLICK) ||
(e_config->winlist_warp_at_end) ||
(e_config->winlist_warp_while_selecting))
(e_config->winlist_warp_while_selecting)))
{
_warp_to_x = _bd_next->x + (_bd_next->w / 2);
if (_warp_to_x < (_bd_next->zone->x + 1))
@ -729,9 +731,10 @@ e_winlist_up(E_Zone *zone)
if (!bd_orig->lock_focus_out)
e_border_focus_set(bd_orig, 0, 0);
if ((e_config->focus_policy != E_FOCUS_CLICK) ||
if ((!e_config->disable_all_pointer_warps) &&
((e_config->focus_policy != E_FOCUS_CLICK) ||
(e_config->winlist_warp_at_end) ||
(e_config->winlist_warp_while_selecting))
(e_config->winlist_warp_while_selecting)))
{
_warp_to_x = _bd_next->x + (_bd_next->w / 2);
if (_warp_to_x < (_bd_next->zone->x + 1))
@ -853,9 +856,10 @@ e_winlist_right(E_Zone *zone)
if (!bd_orig->lock_focus_out)
e_border_focus_set(bd_orig, 0, 0);
if ((e_config->focus_policy != E_FOCUS_CLICK) ||
if ((!e_config->disable_all_pointer_warps) &&
((e_config->focus_policy != E_FOCUS_CLICK) ||
(e_config->winlist_warp_at_end) ||
(e_config->winlist_warp_while_selecting))
(e_config->winlist_warp_while_selecting)))
{
_warp_to_x = _bd_next->x + (_bd_next->w / 2);
if (_warp_to_x < (_bd_next->zone->x + 1))
@ -1122,9 +1126,10 @@ _e_winlist_activate(void)
ok = 1;
if (ok)
{
if ((e_config->focus_policy != E_FOCUS_CLICK) ||
if ((!e_config->disable_all_pointer_warps) &&
((e_config->focus_policy != E_FOCUS_CLICK) ||
(e_config->winlist_warp_at_end) ||
(e_config->winlist_warp_while_selecting))
(e_config->winlist_warp_while_selecting)))
{
_warp_to_x = ww->border->x + (ww->border->w / 2);
if (_warp_to_x < (ww->border->zone->x + 1))

View File

@ -57,6 +57,7 @@ wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
e_config->always_click_to_focus = 0;
e_config->focus_last_focused_per_desktop = 1;
e_config->pointer_slide = 0;
e_config->disable_all_pointer_warps = 1;
e_config->winlist_warp_while_selecting = 0;
e_config->winlist_warp_at_end = 0;
e_config->winlist_no_warp_on_direction = 1;