Allow to disable mouse slide on newly focused windows. This is consistent with sloppy and mouse

focus but some users don't like it much, so here is the option...
Remember: It breaks the focus logic when you for example have sloppy focus mode, pointer over a
window but focus on another window!


SVN revision: 33202
This commit is contained in:
Miculcy Brian 2007-12-22 01:46:22 +00:00
parent ee70beaa35
commit 7bb7bb21dd
4 changed files with 17 additions and 6 deletions

View File

@ -1355,11 +1355,7 @@ e_border_focus_set_with_pointer(E_Border *bd)
{
if (e_config->focus_policy == E_FOCUS_SLOPPY)
{
e_border_focus_set(bd, 1, 1);
}
else if (e_config->focus_policy == E_FOCUS_MOUSE)
{
if (e_border_under_pointer_get(NULL, bd))
if (e_border_under_pointer_get(bd->desk, bd))
{
if (!e_border_pointer_warp_to_center(bd))
e_border_focus_set(bd, 1, 1);
@ -7752,6 +7748,9 @@ e_border_pointer_warp_to_center(E_Border *bd)
{
int x, y;
/* Do not slide pointer when disabled (probably breaks focus
* on sloppy/mouse focus but requested by users). */
if (!e_config->pointer_slide) 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

@ -461,6 +461,7 @@ e_config_init(void)
E_CONFIG_VAL(D, T, resize_info_visible, INT); /**/
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, use_e_cursor, INT); /**/
E_CONFIG_VAL(D, T, cursor_size, INT); /**/
E_CONFIG_VAL(D, T, menu_autoscroll_margin, INT); /**/
@ -698,6 +699,7 @@ e_config_init(void)
e_config->resize_info_visible = 1;
e_config->focus_last_focused_per_desktop = 1;
e_config->focus_revert_on_hide_or_close = 1;
e_config->pointer_slide = 1;
e_config->use_e_cursor = 1;
e_config->cursor_size = 32;
e_config->menu_autoscroll_margin = 0;
@ -1550,6 +1552,7 @@ e_config_init(void)
E_CONFIG_LIMIT(e_config->resize_info_visible, 0, 1);
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->use_e_cursor, 0, 1);
E_CONFIG_LIMIT(e_config->cursor_size, 0, 1024);
E_CONFIG_LIMIT(e_config->menu_autoscroll_margin, 0, 50);

View File

@ -33,7 +33,7 @@ typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme;
/* 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 0x0121
#define E_CONFIG_FILE_GENERATION 0x0122
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION)
#define E_EVAS_ENGINE_DEFAULT 0
@ -166,6 +166,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 pointer_slide; // GUI
int use_e_cursor; // GUI
int cursor_size; // GUI
int menu_autoscroll_margin; // GUI

View File

@ -25,6 +25,7 @@ struct _E_Config_Dialog_Data
int always_click_to_focus;
int focus_last_focused_per_desktop;
int focus_revert_on_hide_or_close;
int pointer_slide;
};
/* a nice easy setup function that does the dirty work */
@ -63,6 +64,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->always_click_to_focus = e_config->always_click_to_focus;
cfdata->focus_last_focused_per_desktop = e_config->focus_last_focused_per_desktop;
cfdata->focus_revert_on_hide_or_close = e_config->focus_revert_on_hide_or_close;
cfdata->pointer_slide = e_config->pointer_slide;
cfdata->mode = cfdata->focus_policy;
}
@ -103,6 +105,7 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
e_config->always_click_to_focus = 0;
e_config->focus_last_focused_per_desktop = 1;
e_config->focus_revert_on_hide_or_close = 1;
e_config->pointer_slide = 0;
}
else if (cfdata->mode == E_FOCUS_MOUSE)
{
@ -113,6 +116,7 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
e_config->always_click_to_focus = 0;
e_config->focus_last_focused_per_desktop = 0;
e_config->focus_revert_on_hide_or_close = 0;
e_config->pointer_slide = 1;
}
else
{
@ -123,6 +127,7 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
e_config->always_click_to_focus = 0;
e_config->focus_last_focused_per_desktop = 1;
e_config->focus_revert_on_hide_or_close = 1;
e_config->pointer_slide = 1;
}
e_border_button_bindings_grab_all();
e_config_save_queue();
@ -141,6 +146,7 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
e_config->always_click_to_focus = cfdata->always_click_to_focus;
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_border_button_bindings_grab_all();
e_config_save_queue();
return 1; /* Apply was OK */
@ -207,6 +213,8 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Revert focus when hiding or closing a window"), &(cfdata->focus_revert_on_hide_or_close));
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Slide pointer to a new focused window"), &(cfdata->pointer_slide));
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
return o;