From 31e2299a671290a74e57204d99929c4089f4388e Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 8 Jan 2013 11:51:56 +0000 Subject: add config option for disabling pointer warp when performing directional focus change in winlist, patch by David H. Bronke ticket #2098 SVN revision: 82409 --- src/modules/winlist/e_int_config_winlist.c | 11 ++++- src/modules/winlist/e_winlist.c | 74 +++++++++++++++++------------- src/modules/wizard/page_060.c | 1 + 3 files changed, 52 insertions(+), 34 deletions(-) (limited to 'src/modules') diff --git a/src/modules/winlist/e_int_config_winlist.c b/src/modules/winlist/e_int_config_winlist.c index c8dd92e851..cf12fdf766 100644 --- a/src/modules/winlist/e_int_config_winlist.c +++ b/src/modules/winlist/e_int_config_winlist.c @@ -22,6 +22,7 @@ struct _E_Config_Dialog_Data int focus, raise, uncover; int warp_while_selecting; int warp_at_end; + int no_warp_on_direction; double warp_speed; int jump_desk; @@ -82,6 +83,7 @@ _fill_data(E_Config_Dialog_Data *cfdata) cfdata->warp_while_selecting = e_config->winlist_warp_while_selecting; cfdata->warp_at_end = e_config->winlist_warp_at_end; + cfdata->no_warp_on_direction = e_config->winlist_no_warp_on_direction; cfdata->warp_speed = e_config->winlist_warp_speed; cfdata->scroll_animate = e_config->winlist_scroll_animate; @@ -130,6 +132,7 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata) DO(list_jump_desk_while_selecting, jump_desk); DO(warp_while_selecting, warp_while_selecting); DO(warp_at_end, warp_at_end); + DO(no_warp_on_direction, no_warp_on_direction); DO(warp_speed, warp_speed); DO(scroll_animate, scroll_animate); DO(scroll_speed, scroll_speed); @@ -163,6 +166,7 @@ _basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfda DO(list_jump_desk_while_selecting, jump_desk); DO(warp_while_selecting, warp_while_selecting); DO(warp_at_end, warp_at_end); + DO(no_warp_on_direction, no_warp_on_direction); DO(warp_speed, warp_speed); DO(scroll_animate, scroll_animate); DO(scroll_speed, scroll_speed); @@ -225,6 +229,10 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data &(cfdata->warp_at_end)); e_widget_on_change_hook_set(ob, _warp_changed, cfdata); e_widget_list_object_append(ol, ob, 1, 0, 0.0); + ob = e_widget_check_add(evas, _("Disable mouse warp on directional focus change"), + &(cfdata->no_warp_on_direction)); + e_widget_on_change_hook_set(ob, _warp_changed, cfdata); + e_widget_list_object_append(ol, ob, 1, 0, 0.0); ob = e_widget_check_add(evas, _("Jump to desk"), &(cfdata->jump_desk)); e_widget_list_object_append(ol, ob, 1, 0, 0.0); e_widget_toolbook_page_append(otb, NULL, _("Selecting"), ol, @@ -361,7 +369,8 @@ _warp_changed(void *data, Evas_Object *obj __UNUSED__) Evas_Object *o; Eina_Bool disabled; - disabled = ((!cfdata->warp_while_selecting) && (!cfdata->warp_at_end)); + disabled = ((!cfdata->warp_while_selecting) && (!cfdata->warp_at_end) + && (!cfdata->no_warp_on_direction)); EINA_LIST_FOREACH(cfdata->gui.disable_warp, l, o) e_widget_disabled_set(o, disabled); } diff --git a/src/modules/winlist/e_winlist.c b/src/modules/winlist/e_winlist.c index c53d7e0a55..65f89bd4cd 100644 --- a/src/modules/winlist/e_winlist.c +++ b/src/modules/winlist/e_winlist.c @@ -341,7 +341,7 @@ e_winlist_hide(void) e_object_unref(E_OBJECT(bd)); } - + e_border_idler_before(); ecore_x_window_free(_input_window); @@ -501,14 +501,16 @@ e_winlist_left(E_Zone *zone) _old_warp_x = _old_warp_y = INT_MAX; } - - ecore_x_pointer_xy_get(zone->container->win, &_warp_x, &_warp_y); - _win = &zone->container->win; - _warp_to = 1; - if (!_warp_timer) - _warp_timer = ecore_timer_add(0.01, _e_winlist_warp_timer, NULL); - if (!_animator) - _animator = ecore_animator_add(_e_winlist_animator, NULL); + if (!e_config->winlist_no_warp_on_direction) + { + ecore_x_pointer_xy_get(zone->container->win, &_warp_x, &_warp_y); + _win = &zone->container->win; + _warp_to = 1; + if (!_warp_timer) + _warp_timer = ecore_timer_add(0.01, _e_winlist_warp_timer, NULL); + if (!_animator) + _animator = ecore_animator_add(_e_winlist_animator, NULL); + } if ((!_bd_next->lock_user_stacking) && (e_config->winlist_list_raise_while_selecting)) @@ -623,14 +625,16 @@ e_winlist_down(E_Zone *zone) _old_warp_x = _old_warp_y = INT_MAX; } - - ecore_x_pointer_xy_get(zone->container->win, &_warp_x, &_warp_y); - _win = &zone->container->win; - _warp_to = 1; - if (!_warp_timer) - _warp_timer = ecore_timer_add(0.01, _e_winlist_warp_timer, NULL); - if (!_animator) - _animator = ecore_animator_add(_e_winlist_animator, NULL); + if (!e_config->winlist_no_warp_on_direction) + { + ecore_x_pointer_xy_get(zone->container->win, &_warp_x, &_warp_y); + _win = &zone->container->win; + _warp_to = 1; + if (!_warp_timer) + _warp_timer = ecore_timer_add(0.01, _e_winlist_warp_timer, NULL); + if (!_animator) + _animator = ecore_animator_add(_e_winlist_animator, NULL); + } if ((!_bd_next->lock_user_stacking) && (e_config->winlist_list_raise_while_selecting)) @@ -745,14 +749,16 @@ e_winlist_up(E_Zone *zone) _old_warp_x = _old_warp_y = INT_MAX; } - - ecore_x_pointer_xy_get(zone->container->win, &_warp_x, &_warp_y); - _win = &zone->container->win; - _warp_to = 1; - if (!_warp_timer) - _warp_timer = ecore_timer_add(0.01, _e_winlist_warp_timer, NULL); - if (!_animator) - _animator = ecore_animator_add(_e_winlist_animator, NULL); + if (!e_config->winlist_no_warp_on_direction) + { + ecore_x_pointer_xy_get(zone->container->win, &_warp_x, &_warp_y); + _win = &zone->container->win; + _warp_to = 1; + if (!_warp_timer) + _warp_timer = ecore_timer_add(0.01, _e_winlist_warp_timer, NULL); + if (!_animator) + _animator = ecore_animator_add(_e_winlist_animator, NULL); + } if ((!_bd_next->lock_user_stacking) && (e_config->winlist_list_raise_while_selecting)) @@ -867,14 +873,16 @@ e_winlist_right(E_Zone *zone) _old_warp_x = _old_warp_y = INT_MAX; } - - ecore_x_pointer_xy_get(zone->container->win, &_warp_x, &_warp_y); - _win = &zone->container->win; - _warp_to = 1; - if (!_warp_timer) - _warp_timer = ecore_timer_add(0.01, _e_winlist_warp_timer, NULL); - if (!_animator) - _animator = ecore_animator_add(_e_winlist_animator, NULL); + if (!e_config->winlist_no_warp_on_direction) + { + ecore_x_pointer_xy_get(zone->container->win, &_warp_x, &_warp_y); + _win = &zone->container->win; + _warp_to = 1; + if (!_warp_timer) + _warp_timer = ecore_timer_add(0.01, _e_winlist_warp_timer, NULL); + if (!_animator) + _animator = ecore_animator_add(_e_winlist_animator, NULL); + } if ((!_bd_next->lock_user_stacking) && (e_config->winlist_list_raise_while_selecting)) diff --git a/src/modules/wizard/page_060.c b/src/modules/wizard/page_060.c index be88361991..1cd5235d6a 100644 --- a/src/modules/wizard/page_060.c +++ b/src/modules/wizard/page_060.c @@ -59,6 +59,7 @@ wizard_page_hide(E_Wizard_Page *pg __UNUSED__) e_config->pointer_slide = 0; e_config->winlist_warp_while_selecting = 0; e_config->winlist_warp_at_end = 0; + e_config->winlist_no_warp_on_direction = 1; } else { -- cgit v1.2.1