summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-02-18 10:13:20 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-02-18 10:13:20 +0000
commitb247247dfd8bab7122c9094b5ad5f4748fa1d70c (patch)
treeea821484477bc092c14d081e5ea13d688b151d8e
parent90de0907c24714513005efb3204cf27d9889efab (diff)
fix 2 pointer warp bugs:
* warping to a window which is covered by another window containing the current pointer coordinates * focus changes no longer break sometimes when winlist warping very quickly SVN revision: 84046
Diffstat (limited to '')
-rw-r--r--ChangeLog1
-rw-r--r--NEWS1
-rw-r--r--src/bin/e_border.c53
3 files changed, 37 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 05487d8b4..ea095a430 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
12013-02-18 Mike Blumenkrantz 12013-02-18 Mike Blumenkrantz
2 2
3 * fixed disable of input methods in input method config dialog 3 * fixed disable of input methods in input method config dialog
4 * fixed pointer warp when pointer was inside warp window but not directly over it
4 5
52013-02-13 Deon Thomas 62013-02-13 Deon Thomas
6 7
diff --git a/NEWS b/NEWS
index 9f9514cdf..fa2864587 100644
--- a/NEWS
+++ b/NEWS
@@ -173,3 +173,4 @@ Fixes:
173 * fix crash when locking screen from Start gadget and then activating gadget again 173 * fix crash when locking screen from Start gadget and then activating gadget again
174 * fixed bug where e_layout would ignore frozen state and crash 174 * fixed bug where e_layout would ignore frozen state and crash
175 * fixed disable of input methods in input method config dialog 175 * fixed disable of input methods in input method config dialog
176 * fixed pointer warp when pointer was inside warp window but not directly over it
diff --git a/src/bin/e_border.c b/src/bin/e_border.c
index 28798036c..e4b50c4c2 100644
--- a/src/bin/e_border.c
+++ b/src/bin/e_border.c
@@ -10185,23 +10185,11 @@ e_border_focus_track_thaw(void)
10185 focus_track_frozen--; 10185 focus_track_frozen--;
10186} 10186}
10187 10187
10188EAPI E_Border * 10188static E_Border *
10189e_border_under_pointer_get(E_Desk *desk, 10189_e_border_under_pointer_helper(E_Desk *desk, E_Border *exclude, int x, int y)
10190 E_Border *exclude)
10191{ 10190{
10192 E_Border *bd = NULL, *cbd; 10191 E_Border *bd = NULL, *cbd;
10193 Eina_List *l; 10192 Eina_List *l;
10194 int x, y;
10195
10196 /* We need to ensure that we can get the container window for the
10197 * zone of either the given desk or the desk of the excluded
10198 * window, so return if neither is given */
10199 if (desk)
10200 ecore_x_pointer_xy_get(desk->zone->container->win, &x, &y);
10201 else if (exclude)
10202 ecore_x_pointer_xy_get(exclude->desk->zone->container->win, &x, &y);
10203 else
10204 return NULL;
10205 10193
10206 EINA_LIST_FOREACH(e_border_raise_stack_get(), l, cbd) 10194 EINA_LIST_FOREACH(e_border_raise_stack_get(), l, cbd)
10207 { 10195 {
@@ -10223,6 +10211,25 @@ e_border_under_pointer_get(E_Desk *desk,
10223 return bd; 10211 return bd;
10224} 10212}
10225 10213
10214EAPI E_Border *
10215e_border_under_pointer_get(E_Desk *desk,
10216 E_Border *exclude)
10217{
10218 int x, y;
10219
10220 /* We need to ensure that we can get the container window for the
10221 * zone of either the given desk or the desk of the excluded
10222 * window, so return if neither is given */
10223 if (desk)
10224 ecore_x_pointer_xy_get(desk->zone->container->win, &x, &y);
10225 else if (exclude)
10226 ecore_x_pointer_xy_get(exclude->desk->zone->container->win, &x, &y);
10227 else
10228 return NULL;
10229
10230 return _e_border_under_pointer_helper(desk, exclude, x, y);
10231}
10232
10226static Eina_Bool 10233static Eina_Bool
10227_e_border_pointer_warp_to_center_timer(void *data __UNUSED__) 10234_e_border_pointer_warp_to_center_timer(void *data __UNUSED__)
10228{ 10235{
@@ -10298,9 +10305,6 @@ e_border_pointer_warp_to_center_now(E_Border *bd)
10298 if (e_config->disable_all_pointer_warps) return 0; 10305 if (e_config->disable_all_pointer_warps) return 0;
10299 if (warp_timer_border == bd) 10306 if (warp_timer_border == bd)
10300 { 10307 {
10301 if (warp_timer) ecore_timer_del(warp_timer);
10302 warp_timer = NULL;
10303 warp_timer_border = NULL;
10304 ecore_x_pointer_warp(warp_to_win, warp_to_x, warp_to_y); 10308 ecore_x_pointer_warp(warp_to_win, warp_to_x, warp_to_y);
10305 warp_to = 0; 10309 warp_to = 0;
10306 } 10310 }
@@ -10316,6 +10320,7 @@ EAPI int
10316e_border_pointer_warp_to_center(E_Border *bd) 10320e_border_pointer_warp_to_center(E_Border *bd)
10317{ 10321{
10318 int x, y; 10322 int x, y;
10323 E_Border *cbd = NULL;
10319 10324
10320 if (e_config->disable_all_pointer_warps) return 0; 10325 if (e_config->disable_all_pointer_warps) return 0;
10321 /* Only warp the pointer if it is not already in the area of 10326 /* Only warp the pointer if it is not already in the area of
@@ -10323,7 +10328,10 @@ e_border_pointer_warp_to_center(E_Border *bd)
10323 ecore_x_pointer_xy_get(bd->zone->container->win, &x, &y); 10328 ecore_x_pointer_xy_get(bd->zone->container->win, &x, &y);
10324 if ((x >= bd->x) && (x <= (bd->x + bd->w)) && 10329 if ((x >= bd->x) && (x <= (bd->x + bd->w)) &&
10325 (y >= bd->y) && (y <= (bd->y + bd->h))) 10330 (y >= bd->y) && (y <= (bd->y + bd->h)))
10326 return 0; 10331 {
10332 cbd = _e_border_under_pointer_helper(bd->desk, bd, x, y);
10333 if (cbd == bd) return 0;
10334 }
10327 10335
10328 warp_to_x = bd->x + (bd->w / 2); 10336 warp_to_x = bd->x + (bd->w / 2);
10329 if (warp_to_x < (bd->zone->x + 1)) 10337 if (warp_to_x < (bd->zone->x + 1))
@@ -10337,6 +10345,15 @@ e_border_pointer_warp_to_center(E_Border *bd)
10337 else if (warp_to_y > (bd->zone->y + bd->zone->h)) 10345 else if (warp_to_y > (bd->zone->y + bd->zone->h))
10338 warp_to_y = (bd->zone->y + bd->zone->h + bd->y) / 2; 10346 warp_to_y = (bd->zone->y + bd->zone->h + bd->y) / 2;
10339 10347
10348 /* TODO: handle case where another border is over the exact center,
10349 * find a place where the requested border is not overlapped?
10350 *
10351 if (!cbd) cbd = _e_border_under_pointer_helper(bd->desk, bd, x, y);
10352 if (cbd != bd)
10353 {
10354 }
10355 */
10356
10340 warp_to = 1; 10357 warp_to = 1;
10341 warp_to_win = bd->zone->container->win; 10358 warp_to_win = bd->zone->container->win;
10342 ecore_x_pointer_xy_get(bd->zone->container->win, &warp_x[0], &warp_y[0]); 10359 ecore_x_pointer_xy_get(bd->zone->container->win, &warp_x[0], &warp_y[0]);