diff options
Diffstat (limited to '')
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | src/bin/e_border.c | 76 | ||||
-rw-r--r-- | src/bin/e_border.h | 1 | ||||
-rw-r--r-- | src/modules/winlist/e_winlist.c | 261 |
5 files changed, 71 insertions, 271 deletions
@@ -7,6 +7,8 @@ | |||
7 | * new option for disabling all pointer warps | 7 | * new option for disabling all pointer warps |
8 | * move pointer warp speed option to be general option | 8 | * move pointer warp speed option to be general option |
9 | * new tab in focus settings for pointer warping | 9 | * new tab in focus settings for pointer warping |
10 | * add e_border_pointer_warp_to_center_now() | ||
11 | * unify all pointer warp animators | ||
10 | 12 | ||
11 | 2013-02-04 Mike Blumenkrantz | 13 | 2013-02-04 Mike Blumenkrantz |
12 | 14 | ||
@@ -22,6 +22,7 @@ Additions: | |||
22 | * e_config_xkb functions | 22 | * e_config_xkb functions |
23 | * added functions for freeing binding config structs | 23 | * added functions for freeing binding config structs |
24 | * E_Config_DD structs are now tracked and retrievable through e_config_descriptor_find | 24 | * E_Config_DD structs are now tracked and retrievable through e_config_descriptor_find |
25 | * add e_border_pointer_warp_to_center_now() | ||
25 | Config: | 26 | Config: |
26 | * Added option for disabling icons in menus | 27 | * Added option for disabling icons in menus |
27 | * Added option for disabling pointer warping when performing directional focus changes using winlist | 28 | * Added option for disabling pointer warping when performing directional focus changes using winlist |
@@ -90,6 +91,7 @@ Improvements: | |||
90 | * add support for edje files in filepreview widget | 91 | * add support for edje files in filepreview widget |
91 | * improve load time of apps dialogs | 92 | * improve load time of apps dialogs |
92 | * new tab in focus settings for pointer warping | 93 | * new tab in focus settings for pointer warping |
94 | * unify all pointer warp animators | ||
93 | 95 | ||
94 | Fixes: | 96 | Fixes: |
95 | * IBar menu didn't allow to configure different icon sources, show contents menu even on empty IBar. | 97 | * IBar menu didn't allow to configure different icon sources, show contents menu even on empty IBar. |
diff --git a/src/bin/e_border.c b/src/bin/e_border.c index f8bce2ae0..d4c3589bd 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c | |||
@@ -2158,12 +2158,15 @@ e_border_focus_set_with_pointer(E_Border *bd) | |||
2158 | E_Border *pbd; | 2158 | E_Border *pbd; |
2159 | int ret = 0; | 2159 | int ret = 0; |
2160 | pbd = e_border_under_pointer_get(bd->desk, bd); | 2160 | pbd = e_border_under_pointer_get(bd->desk, bd); |
2161 | if (pbd && (pbd != bd)) ret = e_border_pointer_warp_to_center(bd); | 2161 | /* Do not slide pointer when disabled (probably breaks focus |
2162 | * on sloppy/mouse focus but requested by users). */ | ||
2163 | if (e_config->pointer_slide && pbd && (pbd != bd)) | ||
2164 | ret = e_border_pointer_warp_to_center(bd); | ||
2162 | if (!ret) e_border_focus_set(bd, 1, 0); | 2165 | if (!ret) e_border_focus_set(bd, 1, 0); |
2163 | } | 2166 | } |
2164 | else | 2167 | else |
2165 | { | 2168 | { |
2166 | if (!e_border_pointer_warp_to_center(bd)) | 2169 | if (e_config->pointer_slide && (!e_border_pointer_warp_to_center(bd))) |
2167 | e_border_focus_set(bd, 1, 0); | 2170 | e_border_focus_set(bd, 1, 0); |
2168 | } | 2171 | } |
2169 | } | 2172 | } |
@@ -4488,7 +4491,6 @@ _e_border_move_lost_window_to_center(E_Border *bd) | |||
4488 | static void | 4491 | static void |
4489 | _e_border_reset_lost_window(E_Border *bd) | 4492 | _e_border_reset_lost_window(E_Border *bd) |
4490 | { | 4493 | { |
4491 | int x, y, w, h; | ||
4492 | E_OBJECT_CHECK(bd); | 4494 | E_OBJECT_CHECK(bd); |
4493 | 4495 | ||
4494 | if (bd->during_lost) return; | 4496 | if (bd->during_lost) return; |
@@ -4501,23 +4503,7 @@ _e_border_reset_lost_window(E_Border *bd) | |||
4501 | if (!bd->lock_focus_out) | 4503 | if (!bd->lock_focus_out) |
4502 | e_border_focus_set(bd, 1, 1); | 4504 | e_border_focus_set(bd, 1, 1); |
4503 | 4505 | ||
4504 | if (!e_config->disable_all_pointer_warps) | 4506 | e_border_pointer_warp_to_center(bd); |
4505 | { | ||
4506 | e_zone_useful_geometry_get(bd->zone, &x, &y, &w, &h); | ||
4507 | ecore_x_pointer_xy_get(bd->zone->container->win, &warp_x[0], &warp_y[0]); | ||
4508 | |||
4509 | warp_to_x = x + ((w / 2) - (bd->w / 2)) + (warp_x[0] - bd->x); | ||
4510 | warp_to_y = y + ((h / 2) - (bd->h / 2)) + (warp_y[0] - bd->y); | ||
4511 | |||
4512 | warp_to = 1; | ||
4513 | warp_to_win = bd->zone->container->win; | ||
4514 | |||
4515 | if (warp_timer) ecore_timer_del(warp_timer); | ||
4516 | warp_timer = ecore_timer_add(0.01, _e_border_pointer_warp_to_center_timer, bd); | ||
4517 | |||
4518 | e_border_focus_lock_set(EINA_TRUE); | ||
4519 | warp_timer_border = bd; | ||
4520 | } | ||
4521 | bd->during_lost = EINA_FALSE; | 4507 | bd->during_lost = EINA_FALSE; |
4522 | } | 4508 | } |
4523 | 4509 | ||
@@ -10202,7 +10188,8 @@ _e_border_pointer_warp_to_center_timer(void *data __UNUSED__) | |||
10202 | 10188 | ||
10203 | ecore_x_pointer_xy_get(warp_to_win, &x, &y); | 10189 | ecore_x_pointer_xy_get(warp_to_win, &x, &y); |
10204 | /* move hasn't happened yet */ | 10190 | /* move hasn't happened yet */ |
10205 | if ((x == warp_x[1]) && (y == warp_y[1])) return EINA_TRUE; | 10191 | if ((x == warp_x[1]) && (y == warp_y[1])) |
10192 | return EINA_TRUE; | ||
10206 | if ((abs(x - warp_x[0]) > 5) || (abs(y - warp_y[0]) > 5)) | 10193 | if ((abs(x - warp_x[0]) > 5) || (abs(y - warp_y[0]) > 5)) |
10207 | { | 10194 | { |
10208 | /* User moved the mouse, so stop warping */ | 10195 | /* User moved the mouse, so stop warping */ |
@@ -10210,9 +10197,7 @@ _e_border_pointer_warp_to_center_timer(void *data __UNUSED__) | |||
10210 | goto cleanup; | 10197 | goto cleanup; |
10211 | } | 10198 | } |
10212 | 10199 | ||
10213 | /* We just use the same warp speed as configured | 10200 | spd = e_config->pointer_warp_speed; |
10214 | * for the windowlist */ | ||
10215 | spd = e_config->winlist_warp_speed; | ||
10216 | warp_x[1] = x = warp_x[0]; | 10201 | warp_x[1] = x = warp_x[0]; |
10217 | warp_y[1] = y = warp_y[0]; | 10202 | warp_y[1] = y = warp_y[0]; |
10218 | warp_x[0] = (x * (1.0 - spd)) + (warp_to_x * spd); | 10203 | warp_x[0] = (x * (1.0 - spd)) + (warp_to_x * spd); |
@@ -10230,20 +10215,57 @@ _e_border_pointer_warp_to_center_timer(void *data __UNUSED__) | |||
10230 | cleanup: | 10215 | cleanup: |
10231 | ecore_timer_del(warp_timer); | 10216 | ecore_timer_del(warp_timer); |
10232 | warp_timer = NULL; | 10217 | warp_timer = NULL; |
10218 | warp_x[0] = warp_x[1] = warp_y[0] = warp_y[1] = -1; | ||
10233 | e_border_focus_lock_set(EINA_FALSE); | 10219 | e_border_focus_lock_set(EINA_FALSE); |
10234 | e_focus_event_mouse_in(warp_timer_border); | 10220 | e_focus_event_mouse_in(warp_timer_border); |
10221 | if (warp_timer_border->iconic) | ||
10222 | { | ||
10223 | if (!warp_timer_border->lock_user_iconify) | ||
10224 | e_border_uniconify(warp_timer_border); | ||
10225 | } | ||
10226 | if (warp_timer_border->shaded) | ||
10227 | { | ||
10228 | if (!warp_timer_border->lock_user_shade) | ||
10229 | e_border_unshade(warp_timer_border, warp_timer_border->shade.dir); | ||
10230 | } | ||
10231 | else if (warp_timer_border->desk) | ||
10232 | { | ||
10233 | if (!warp_timer_border->sticky) e_desk_show(warp_timer_border->desk); | ||
10234 | } | ||
10235 | if (!warp_timer_border->lock_user_stacking) | ||
10236 | e_border_raise(warp_timer_border); | ||
10237 | |||
10238 | if (!warp_timer_border->lock_focus_out) | ||
10239 | { | ||
10240 | e_border_focus_set(warp_timer_border, 1, 1); | ||
10241 | e_border_focus_latest_set(warp_timer_border); | ||
10242 | } | ||
10235 | warp_timer_border = NULL; | 10243 | warp_timer_border = NULL; |
10236 | return ECORE_CALLBACK_CANCEL; | 10244 | return ECORE_CALLBACK_CANCEL; |
10237 | } | 10245 | } |
10238 | 10246 | ||
10239 | EAPI int | 10247 | EAPI int |
10248 | e_border_pointer_warp_to_center_now(E_Border *bd) | ||
10249 | { | ||
10250 | if (e_config->disable_all_pointer_warps) return 0; | ||
10251 | if (warp_timer_border == bd) | ||
10252 | { | ||
10253 | ecore_x_pointer_warp(warp_to_win, warp_to_x, warp_to_y); | ||
10254 | warp_to = 0; | ||
10255 | } | ||
10256 | else | ||
10257 | { | ||
10258 | if (e_border_pointer_warp_to_center(bd)) | ||
10259 | e_border_pointer_warp_to_center_now(bd); | ||
10260 | } | ||
10261 | return 1; | ||
10262 | } | ||
10263 | |||
10264 | EAPI int | ||
10240 | e_border_pointer_warp_to_center(E_Border *bd) | 10265 | e_border_pointer_warp_to_center(E_Border *bd) |
10241 | { | 10266 | { |
10242 | int x, y; | 10267 | int x, y; |
10243 | 10268 | ||
10244 | /* Do not slide pointer when disabled (probably breaks focus | ||
10245 | * on sloppy/mouse focus but requested by users). */ | ||
10246 | if (!e_config->pointer_slide) return 0; | ||
10247 | if (e_config->disable_all_pointer_warps) return 0; | 10269 | if (e_config->disable_all_pointer_warps) return 0; |
10248 | /* Only warp the pointer if it is not already in the area of | 10270 | /* Only warp the pointer if it is not already in the area of |
10249 | * the given border */ | 10271 | * the given border */ |
diff --git a/src/bin/e_border.h b/src/bin/e_border.h index af42464ff..ac239de04 100644 --- a/src/bin/e_border.h +++ b/src/bin/e_border.h | |||
@@ -807,6 +807,7 @@ EAPI void e_border_focus_track_freeze(void); | |||
807 | EAPI void e_border_focus_track_thaw(void); | 807 | EAPI void e_border_focus_track_thaw(void); |
808 | 808 | ||
809 | EAPI E_Border *e_border_under_pointer_get(E_Desk *desk, E_Border *exclude); | 809 | EAPI E_Border *e_border_under_pointer_get(E_Desk *desk, E_Border *exclude); |
810 | EAPI int e_border_pointer_warp_to_center_now(E_Border *bd); | ||
810 | EAPI int e_border_pointer_warp_to_center(E_Border *bd); | 811 | EAPI int e_border_pointer_warp_to_center(E_Border *bd); |
811 | 812 | ||
812 | EAPI void e_border_comp_hidden_set(E_Border *bd, Eina_Bool hidden); | 813 | EAPI void e_border_comp_hidden_set(E_Border *bd, Eina_Bool hidden); |
diff --git a/src/modules/winlist/e_winlist.c b/src/modules/winlist/e_winlist.c index 3d8acac81..f4179eebe 100644 --- a/src/modules/winlist/e_winlist.c +++ b/src/modules/winlist/e_winlist.c | |||
@@ -29,7 +29,6 @@ static Eina_Bool _e_winlist_cb_mouse_up(void *data, int type, void *event); | |||
29 | static Eina_Bool _e_winlist_cb_mouse_wheel(void *data, int type, void *event); | 29 | static Eina_Bool _e_winlist_cb_mouse_wheel(void *data, int type, void *event); |
30 | static Eina_Bool _e_winlist_cb_mouse_move(void *data, int type, void *event); | 30 | static Eina_Bool _e_winlist_cb_mouse_move(void *data, int type, void *event); |
31 | static Eina_Bool _e_winlist_scroll_timer(void *data); | 31 | static Eina_Bool _e_winlist_scroll_timer(void *data); |
32 | static Eina_Bool _e_winlist_warp_timer(void *data); | ||
33 | static Eina_Bool _e_winlist_animator(void *data); | 32 | static Eina_Bool _e_winlist_animator(void *data); |
34 | #if 0 | 33 | #if 0 |
35 | static void _e_winlist_cb_item_mouse_in(void *data, Evas *evas, | 34 | static void _e_winlist_cb_item_mouse_in(void *data, Evas *evas, |
@@ -52,20 +51,12 @@ static int _hold_mod = 0; | |||
52 | static E_Winlist_Activate_Type _activate_type = 0; | 51 | static E_Winlist_Activate_Type _activate_type = 0; |
53 | static Eina_List *_handlers = NULL; | 52 | static Eina_List *_handlers = NULL; |
54 | static Ecore_X_Window _input_window = 0; | 53 | static Ecore_X_Window _input_window = 0; |
55 | static int _warp_to = 0; | ||
56 | static int _warp_to_x = 0; | ||
57 | static int _warp_to_y = 0; | ||
58 | static int _warp_x = 0; | ||
59 | static int _warp_y = 0; | ||
60 | static int _old_warp_x = 0; | ||
61 | static int _old_warp_y = 0; | ||
62 | static int _scroll_to = 0; | 54 | static int _scroll_to = 0; |
63 | static double _scroll_align_to = 0.0; | 55 | static double _scroll_align_to = 0.0; |
64 | static double _scroll_align = 0.0; | 56 | static double _scroll_align = 0.0; |
65 | static Ecore_Timer *_warp_timer = NULL; | 57 | static Ecore_Timer *_warp_timer = NULL; |
66 | static Ecore_Timer *_scroll_timer = NULL; | 58 | static Ecore_Timer *_scroll_timer = NULL; |
67 | static Ecore_Animator *_animator = NULL; | 59 | static Ecore_Animator *_animator = NULL; |
68 | static const Ecore_X_Window *_win = NULL; | ||
69 | static E_Border *_bd_next = NULL; | 60 | static E_Border *_bd_next = NULL; |
70 | 61 | ||
71 | static Eina_Bool | 62 | static Eina_Bool |
@@ -301,44 +292,7 @@ e_winlist_hide(void) | |||
301 | } | 292 | } |
302 | if (bd) | 293 | if (bd) |
303 | { | 294 | { |
304 | if (bd->shaded) | 295 | e_border_pointer_warp_to_center_now(bd); |
305 | { | ||
306 | if (!bd->lock_user_shade) | ||
307 | e_border_unshade(bd, bd->shade.dir); | ||
308 | } | ||
309 | else if (bd->desk) | ||
310 | { | ||
311 | if (!bd->sticky) e_desk_show(bd->desk); | ||
312 | } | ||
313 | if (!bd->lock_user_stacking) | ||
314 | e_border_raise(bd); | ||
315 | |||
316 | if (!bd->lock_focus_out) | ||
317 | { | ||
318 | e_border_focus_set(bd, 1, 1); | ||
319 | e_border_focus_latest_set(bd); | ||
320 | e_border_focus_set(bd, 1, 1); | ||
321 | } | ||
322 | if ((e_config->focus_policy != E_FOCUS_CLICK) || | ||
323 | (e_config->winlist_warp_at_end) || | ||
324 | (e_config->winlist_warp_while_selecting)) | ||
325 | { | ||
326 | _warp_to_x = bd->x + (bd->w / 2); | ||
327 | if (_warp_to_x < (bd->zone->x + 1)) | ||
328 | _warp_to_x = bd->zone->x + | ||
329 | ((bd->x + bd->w - bd->zone->x) / 2); | ||
330 | else if (_warp_to_x >= (bd->zone->x + bd->zone->w - 1)) | ||
331 | _warp_to_x = (bd->zone->x + bd->zone->w + bd->x) / 2; | ||
332 | |||
333 | _warp_to_y = bd->y + (bd->h / 2); | ||
334 | if (_warp_to_y < (bd->zone->y + 1)) | ||
335 | _warp_to_y = bd->zone->y + | ||
336 | ((bd->y + bd->h - bd->zone->y) / 2); | ||
337 | else if (_warp_to_y >= (bd->zone->y + bd->zone->h - 1)) | ||
338 | _warp_to_y = (bd->zone->y + bd->zone->h + bd->y) / 2; | ||
339 | ecore_x_pointer_warp(bd->zone->container->win, _warp_to_x, _warp_to_y); | ||
340 | } | ||
341 | |||
342 | e_object_unref(E_OBJECT(bd)); | 296 | e_object_unref(E_OBJECT(bd)); |
343 | } | 297 | } |
344 | 298 | ||
@@ -481,34 +435,12 @@ e_winlist_left(E_Zone *zone) | |||
481 | if (!bd_orig->lock_focus_out) | 435 | if (!bd_orig->lock_focus_out) |
482 | e_border_focus_set(bd_orig, 0, 0); | 436 | e_border_focus_set(bd_orig, 0, 0); |
483 | 437 | ||
484 | if ((!e_config->disable_all_pointer_warps) && | 438 | if ((!e_config->winlist_no_warp_on_direction) && |
485 | ((e_config->focus_policy != E_FOCUS_CLICK) || | 439 | ((e_config->focus_policy != E_FOCUS_CLICK) || |
486 | (e_config->winlist_warp_at_end) || | 440 | (e_config->winlist_warp_at_end) || |
487 | (e_config->winlist_warp_while_selecting))) | 441 | (e_config->winlist_warp_while_selecting))) |
488 | { | 442 | { |
489 | _warp_to_x = _bd_next->x + (_bd_next->w / 2); | 443 | e_border_pointer_warp_to_center(_bd_next); |
490 | if (_warp_to_x < (_bd_next->zone->x + 1)) | ||
491 | _warp_to_x = _bd_next->zone->x + | ||
492 | ((_bd_next->x + _bd_next->w - _bd_next->zone->x) / 2); | ||
493 | else if (_warp_to_x >= (_bd_next->zone->x + _bd_next->zone->w - 1)) | ||
494 | _warp_to_x = (_bd_next->zone->x + _bd_next->zone->w + _bd_next->x) / 2; | ||
495 | |||
496 | _warp_to_y = _bd_next->y + (_bd_next->h / 2); | ||
497 | if (_warp_to_y < (_bd_next->zone->y + 1)) | ||
498 | _warp_to_y = _bd_next->zone->y + | ||
499 | ((_bd_next->y + _bd_next->h - _bd_next->zone->y) / 2); | ||
500 | else if (_warp_to_y >= (_bd_next->zone->y + _bd_next->zone->h - 1)) | ||
501 | _warp_to_y = (_bd_next->zone->y + _bd_next->zone->h + _bd_next->y) / 2; | ||
502 | |||
503 | _old_warp_x = _old_warp_y = INT_MAX; | ||
504 | } | ||
505 | if (!e_config->winlist_no_warp_on_direction) | ||
506 | { | ||
507 | ecore_x_pointer_xy_get(zone->container->win, &_warp_x, &_warp_y); | ||
508 | _win = &zone->container->win; | ||
509 | _warp_to = 1; | ||
510 | if (!_warp_timer) | ||
511 | _warp_timer = ecore_timer_add(0.01, _e_winlist_warp_timer, NULL); | ||
512 | if (!_animator) | 444 | if (!_animator) |
513 | _animator = ecore_animator_add(_e_winlist_animator, NULL); | 445 | _animator = ecore_animator_add(_e_winlist_animator, NULL); |
514 | } | 446 | } |
@@ -606,34 +538,12 @@ e_winlist_down(E_Zone *zone) | |||
606 | if (!bd_orig->lock_focus_out) | 538 | if (!bd_orig->lock_focus_out) |
607 | e_border_focus_set(bd_orig, 0, 0); | 539 | e_border_focus_set(bd_orig, 0, 0); |
608 | 540 | ||
609 | if ((!e_config->disable_all_pointer_warps) && | 541 | if ((!e_config->winlist_no_warp_on_direction) && |
610 | ((e_config->focus_policy != E_FOCUS_CLICK) || | 542 | ((e_config->focus_policy != E_FOCUS_CLICK) || |
611 | (e_config->winlist_warp_at_end) || | 543 | (e_config->winlist_warp_at_end) || |
612 | (e_config->winlist_warp_while_selecting))) | 544 | (e_config->winlist_warp_while_selecting))) |
613 | { | 545 | { |
614 | _warp_to_x = _bd_next->x + (_bd_next->w / 2); | 546 | e_border_pointer_warp_to_center(_bd_next); |
615 | if (_warp_to_x < (_bd_next->zone->x + 1)) | ||
616 | _warp_to_x = _bd_next->zone->x + | ||
617 | ((_bd_next->x + _bd_next->w - _bd_next->zone->x) / 2); | ||
618 | else if (_warp_to_x >= (_bd_next->zone->x + _bd_next->zone->w - 1)) | ||
619 | _warp_to_x = (_bd_next->zone->x + _bd_next->zone->w + _bd_next->x) / 2; | ||
620 | |||
621 | _warp_to_y = _bd_next->y + (_bd_next->h / 2); | ||
622 | if (_warp_to_y < (_bd_next->zone->y + 1)) | ||
623 | _warp_to_y = _bd_next->zone->y + | ||
624 | ((_bd_next->y + _bd_next->h - _bd_next->zone->y) / 2); | ||
625 | else if (_warp_to_y >= (_bd_next->zone->y + _bd_next->zone->h - 1)) | ||
626 | _warp_to_y = (_bd_next->zone->y + _bd_next->zone->h + _bd_next->y) / 2; | ||
627 | |||
628 | _old_warp_x = _old_warp_y = INT_MAX; | ||
629 | } | ||
630 | if (!e_config->winlist_no_warp_on_direction) | ||
631 | { | ||
632 | ecore_x_pointer_xy_get(zone->container->win, &_warp_x, &_warp_y); | ||
633 | _win = &zone->container->win; | ||
634 | _warp_to = 1; | ||
635 | if (!_warp_timer) | ||
636 | _warp_timer = ecore_timer_add(0.01, _e_winlist_warp_timer, NULL); | ||
637 | if (!_animator) | 547 | if (!_animator) |
638 | _animator = ecore_animator_add(_e_winlist_animator, NULL); | 548 | _animator = ecore_animator_add(_e_winlist_animator, NULL); |
639 | } | 549 | } |
@@ -731,34 +641,12 @@ e_winlist_up(E_Zone *zone) | |||
731 | if (!bd_orig->lock_focus_out) | 641 | if (!bd_orig->lock_focus_out) |
732 | e_border_focus_set(bd_orig, 0, 0); | 642 | e_border_focus_set(bd_orig, 0, 0); |
733 | 643 | ||
734 | if ((!e_config->disable_all_pointer_warps) && | 644 | if ((!e_config->winlist_no_warp_on_direction) && |
735 | ((e_config->focus_policy != E_FOCUS_CLICK) || | 645 | ((e_config->focus_policy != E_FOCUS_CLICK) || |
736 | (e_config->winlist_warp_at_end) || | 646 | (e_config->winlist_warp_at_end) || |
737 | (e_config->winlist_warp_while_selecting))) | 647 | (e_config->winlist_warp_while_selecting))) |
738 | { | 648 | { |
739 | _warp_to_x = _bd_next->x + (_bd_next->w / 2); | 649 | e_border_pointer_warp_to_center(_bd_next); |
740 | if (_warp_to_x < (_bd_next->zone->x + 1)) | ||
741 | _warp_to_x = _bd_next->zone->x + | ||
742 | ((_bd_next->x + _bd_next->w - _bd_next->zone->x) / 2); | ||
743 | else if (_warp_to_x >= (_bd_next->zone->x + _bd_next->zone->w - 1)) | ||
744 | _warp_to_x = (_bd_next->zone->x + _bd_next->zone->w + _bd_next->x) / 2; | ||
745 | |||
746 | _warp_to_y = _bd_next->y + (_bd_next->h / 2); | ||
747 | if (_warp_to_y < (_bd_next->zone->y + 1)) | ||
748 | _warp_to_y = _bd_next->zone->y + | ||
749 | ((_bd_next->y + _bd_next->h - _bd_next->zone->y) / 2); | ||
750 | else if (_warp_to_y >= (_bd_next->zone->y + _bd_next->zone->h - 1)) | ||
751 | _warp_to_y = (_bd_next->zone->y + _bd_next->zone->h + _bd_next->y) / 2; | ||
752 | |||
753 | _old_warp_x = _old_warp_y = INT_MAX; | ||
754 | } | ||
755 | if (!e_config->winlist_no_warp_on_direction) | ||
756 | { | ||
757 | ecore_x_pointer_xy_get(zone->container->win, &_warp_x, &_warp_y); | ||
758 | _win = &zone->container->win; | ||
759 | _warp_to = 1; | ||
760 | if (!_warp_timer) | ||
761 | _warp_timer = ecore_timer_add(0.01, _e_winlist_warp_timer, NULL); | ||
762 | if (!_animator) | 650 | if (!_animator) |
763 | _animator = ecore_animator_add(_e_winlist_animator, NULL); | 651 | _animator = ecore_animator_add(_e_winlist_animator, NULL); |
764 | } | 652 | } |
@@ -856,34 +744,12 @@ e_winlist_right(E_Zone *zone) | |||
856 | if (!bd_orig->lock_focus_out) | 744 | if (!bd_orig->lock_focus_out) |
857 | e_border_focus_set(bd_orig, 0, 0); | 745 | e_border_focus_set(bd_orig, 0, 0); |
858 | 746 | ||
859 | if ((!e_config->disable_all_pointer_warps) && | 747 | if ((!e_config->winlist_no_warp_on_direction) && |
860 | ((e_config->focus_policy != E_FOCUS_CLICK) || | 748 | ((e_config->focus_policy != E_FOCUS_CLICK) || |
861 | (e_config->winlist_warp_at_end) || | 749 | (e_config->winlist_warp_at_end) || |
862 | (e_config->winlist_warp_while_selecting))) | 750 | (e_config->winlist_warp_while_selecting))) |
863 | { | 751 | { |
864 | _warp_to_x = _bd_next->x + (_bd_next->w / 2); | 752 | e_border_pointer_warp_to_center(_bd_next); |
865 | if (_warp_to_x < (_bd_next->zone->x + 1)) | ||
866 | _warp_to_x = _bd_next->zone->x + | ||
867 | ((_bd_next->x + _bd_next->w - _bd_next->zone->x) / 2); | ||
868 | else if (_warp_to_x >= (_bd_next->zone->x + _bd_next->zone->w - 1)) | ||
869 | _warp_to_x = (_bd_next->zone->x + _bd_next->zone->w + _bd_next->x) / 2; | ||
870 | |||
871 | _warp_to_y = _bd_next->y + (_bd_next->h / 2); | ||
872 | if (_warp_to_y < (_bd_next->zone->y + 1)) | ||
873 | _warp_to_y = _bd_next->zone->y + | ||
874 | ((_bd_next->y + _bd_next->h - _bd_next->zone->y) / 2); | ||
875 | else if (_warp_to_y >= (_bd_next->zone->y + _bd_next->zone->h - 1)) | ||
876 | _warp_to_y = (_bd_next->zone->y + _bd_next->zone->h + _bd_next->y) / 2; | ||
877 | |||
878 | _old_warp_x = _old_warp_y = INT_MAX; | ||
879 | } | ||
880 | if (!e_config->winlist_no_warp_on_direction) | ||
881 | { | ||
882 | ecore_x_pointer_xy_get(zone->container->win, &_warp_x, &_warp_y); | ||
883 | _win = &zone->container->win; | ||
884 | _warp_to = 1; | ||
885 | if (!_warp_timer) | ||
886 | _warp_timer = ecore_timer_add(0.01, _e_winlist_warp_timer, NULL); | ||
887 | if (!_animator) | 753 | if (!_animator) |
888 | _animator = ecore_animator_add(_e_winlist_animator, NULL); | 754 | _animator = ecore_animator_add(_e_winlist_animator, NULL); |
889 | } | 755 | } |
@@ -1126,52 +992,19 @@ _e_winlist_activate(void) | |||
1126 | ok = 1; | 992 | ok = 1; |
1127 | if (ok) | 993 | if (ok) |
1128 | { | 994 | { |
1129 | if ((!e_config->disable_all_pointer_warps) && | 995 | if ((e_config->winlist_warp_while_selecting) && |
1130 | ((e_config->focus_policy != E_FOCUS_CLICK) || | 996 | ((e_config->focus_policy != E_FOCUS_CLICK) || |
1131 | (e_config->winlist_warp_at_end) || | 997 | (e_config->winlist_warp_at_end) || |
1132 | (e_config->winlist_warp_while_selecting))) | 998 | (e_config->winlist_warp_while_selecting))) |
1133 | { | 999 | { |
1134 | _warp_to_x = ww->border->x + (ww->border->w / 2); | 1000 | e_border_pointer_warp_to_center(ww->border); |
1135 | if (_warp_to_x < (ww->border->zone->x + 1)) | 1001 | if (!_animator) |
1136 | _warp_to_x = ww->border->zone->x + | 1002 | _animator = ecore_animator_add(_e_winlist_animator, NULL); |
1137 | ((ww->border->x + ww->border->w - ww->border->zone->x) / 2); | ||
1138 | else if (_warp_to_x >= (ww->border->zone->x + ww->border->zone->w - 1)) | ||
1139 | _warp_to_x = (ww->border->zone->x + | ||
1140 | ww->border->zone->w + ww->border->x) / 2; | ||
1141 | |||
1142 | _warp_to_y = ww->border->y + (ww->border->h / 2); | ||
1143 | if (_warp_to_y < (ww->border->zone->y + 1)) | ||
1144 | _warp_to_y = ww->border->zone->y + | ||
1145 | ((ww->border->y + ww->border->h - ww->border->zone->y) / 2); | ||
1146 | else if (_warp_to_y >= (ww->border->zone->y + ww->border->zone->h - 1)) | ||
1147 | _warp_to_y = (ww->border->zone->y + | ||
1148 | ww->border->zone->h + ww->border->y) / 2; | ||
1149 | } | ||
1150 | if (e_config->winlist_warp_while_selecting) | ||
1151 | { | ||
1152 | ecore_x_pointer_xy_get(_winlist->zone->container->win, | ||
1153 | &_warp_x, &_warp_y); | ||
1154 | _win = &_winlist->zone->container->win; | ||
1155 | e_border_focus_latest_set(ww->border); | ||
1156 | _warp_to = 1; | ||
1157 | if (!_warp_timer) | ||
1158 | _warp_timer = ecore_timer_add(0.01, _e_winlist_warp_timer, NULL); | ||
1159 | if (!_animator) | ||
1160 | _animator = ecore_animator_add(_e_winlist_animator, NULL); | ||
1161 | } | 1003 | } |
1162 | else | 1004 | else |
1163 | { | 1005 | { |
1164 | _warp_to = 0; | 1006 | E_FN_DEL(ecore_timer_del, _warp_timer); |
1165 | if (_warp_timer) | 1007 | E_FN_DEL(ecore_animator_del, _animator); |
1166 | { | ||
1167 | ecore_timer_del(_warp_timer); | ||
1168 | _warp_timer = NULL; | ||
1169 | } | ||
1170 | if (_animator) | ||
1171 | { | ||
1172 | ecore_animator_del(_animator); | ||
1173 | _animator = NULL; | ||
1174 | } | ||
1175 | } | 1008 | } |
1176 | 1009 | ||
1177 | if ((!ww->border->lock_user_stacking) && | 1010 | if ((!ww->border->lock_user_stacking) && |
@@ -1529,35 +1362,8 @@ _e_winlist_scroll_timer(void *data __UNUSED__) | |||
1529 | } | 1362 | } |
1530 | 1363 | ||
1531 | static Eina_Bool | 1364 | static Eina_Bool |
1532 | _e_winlist_warp_timer(void *data __UNUSED__) | ||
1533 | { | ||
1534 | if (_warp_to && _warp_timer) | ||
1535 | { | ||
1536 | double spd = e_config->winlist_warp_speed; | ||
1537 | |||
1538 | _old_warp_x = _warp_x; | ||
1539 | _old_warp_y = _warp_y; | ||
1540 | _warp_x = (_warp_x * (1.0 - spd)) + (_warp_to_x * spd); | ||
1541 | _warp_y = (_warp_y * (1.0 - spd)) + (_warp_to_y * spd); | ||
1542 | return ECORE_CALLBACK_RENEW; | ||
1543 | } | ||
1544 | _warp_timer = NULL; | ||
1545 | return ECORE_CALLBACK_CANCEL; | ||
1546 | } | ||
1547 | |||
1548 | static Eina_Bool | ||
1549 | _e_winlist_animator(void *data __UNUSED__) | 1365 | _e_winlist_animator(void *data __UNUSED__) |
1550 | { | 1366 | { |
1551 | if (_warp_to) | ||
1552 | { | ||
1553 | if (_warp_x == _old_warp_x && _warp_y == _old_warp_y) | ||
1554 | { | ||
1555 | _warp_x = _warp_to_x; | ||
1556 | _warp_y = _warp_to_y; | ||
1557 | _warp_to = 0; | ||
1558 | } | ||
1559 | if (_win) ecore_x_pointer_warp(*_win, _warp_x, _warp_y); | ||
1560 | } | ||
1561 | if (_scroll_to) | 1367 | if (_scroll_to) |
1562 | { | 1368 | { |
1563 | double da; | 1369 | double da; |
@@ -1571,41 +1377,8 @@ _e_winlist_animator(void *data __UNUSED__) | |||
1571 | } | 1377 | } |
1572 | e_box_align_set(_list_object, 0.5, 1.0 - _scroll_align); | 1378 | e_box_align_set(_list_object, 0.5, 1.0 - _scroll_align); |
1573 | } | 1379 | } |
1574 | if ((_warp_to) || (_scroll_to)) return ECORE_CALLBACK_RENEW; | 1380 | if (!_scroll_to) _animator = NULL; |
1575 | if (_bd_next) | 1381 | return _scroll_to; |
1576 | { | ||
1577 | if (_bd_next->iconic) | ||
1578 | { | ||
1579 | if (!_bd_next->lock_user_iconify) | ||
1580 | e_border_uniconify(_bd_next); | ||
1581 | } | ||
1582 | if (_bd_next->shaded) | ||
1583 | { | ||
1584 | if (!_bd_next->lock_user_shade) | ||
1585 | e_border_unshade(_bd_next, _bd_next->shade.dir); | ||
1586 | } | ||
1587 | else if (_bd_next->desk) | ||
1588 | { | ||
1589 | if (!_bd_next->sticky) e_desk_show(_bd_next->desk); | ||
1590 | } | ||
1591 | if (!_bd_next->lock_user_stacking) | ||
1592 | e_border_raise(_bd_next); | ||
1593 | |||
1594 | if (!_bd_next->lock_focus_out) | ||
1595 | { | ||
1596 | e_border_focus_set(_bd_next, 1, 1); | ||
1597 | e_border_focus_latest_set(_bd_next); | ||
1598 | } | ||
1599 | if ((e_config->focus_policy != E_FOCUS_CLICK) || | ||
1600 | (e_config->winlist_warp_at_end) || | ||
1601 | (e_config->winlist_warp_while_selecting)) | ||
1602 | ecore_x_pointer_warp(_bd_next->zone->container->win, | ||
1603 | _warp_to_x, _warp_to_y); | ||
1604 | _bd_next = NULL; | ||
1605 | } | ||
1606 | _animator = NULL; | ||
1607 | _win = NULL; | ||
1608 | return ECORE_CALLBACK_CANCEL; | ||
1609 | } | 1382 | } |
1610 | 1383 | ||
1611 | #if 0 | 1384 | #if 0 |