aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 @@
2013-02-18 Mike Blumenkrantz
* fixed disable of input methods in input method config dialog
+ * fixed pointer warp when pointer was inside warp window but not directly over it
2013-02-13 Deon Thomas
diff --git a/NEWS b/NEWS
index 9f9514cdf..fa2864587 100644
--- a/NEWS
+++ b/NEWS
@@ -173,3 +173,4 @@ Fixes:
* fix crash when locking screen from Start gadget and then activating gadget again
* fixed bug where e_layout would ignore frozen state and crash
* fixed disable of input methods in input method config dialog
+ * 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)
focus_track_frozen--;
}
-EAPI E_Border *
-e_border_under_pointer_get(E_Desk *desk,
- E_Border *exclude)
+static E_Border *
+_e_border_under_pointer_helper(E_Desk *desk, E_Border *exclude, int x, int y)
{
E_Border *bd = NULL, *cbd;
Eina_List *l;
- int x, y;
-
- /* We need to ensure that we can get the container window for the
- * zone of either the given desk or the desk of the excluded
- * window, so return if neither is given */
- if (desk)
- ecore_x_pointer_xy_get(desk->zone->container->win, &x, &y);
- else if (exclude)
- ecore_x_pointer_xy_get(exclude->desk->zone->container->win, &x, &y);
- else
- return NULL;
EINA_LIST_FOREACH(e_border_raise_stack_get(), l, cbd)
{
@@ -10223,6 +10211,25 @@ e_border_under_pointer_get(E_Desk *desk,
return bd;
}
+EAPI E_Border *
+e_border_under_pointer_get(E_Desk *desk,
+ E_Border *exclude)
+{
+ int x, y;
+
+ /* We need to ensure that we can get the container window for the
+ * zone of either the given desk or the desk of the excluded
+ * window, so return if neither is given */
+ if (desk)
+ ecore_x_pointer_xy_get(desk->zone->container->win, &x, &y);
+ else if (exclude)
+ ecore_x_pointer_xy_get(exclude->desk->zone->container->win, &x, &y);
+ else
+ return NULL;
+
+ return _e_border_under_pointer_helper(desk, exclude, x, y);
+}
+
static Eina_Bool
_e_border_pointer_warp_to_center_timer(void *data __UNUSED__)
{
@@ -10298,9 +10305,6 @@ e_border_pointer_warp_to_center_now(E_Border *bd)
if (e_config->disable_all_pointer_warps) return 0;
if (warp_timer_border == bd)
{
- if (warp_timer) ecore_timer_del(warp_timer);
- warp_timer = NULL;
- warp_timer_border = NULL;
ecore_x_pointer_warp(warp_to_win, warp_to_x, warp_to_y);
warp_to = 0;
}
@@ -10316,6 +10320,7 @@ EAPI int
e_border_pointer_warp_to_center(E_Border *bd)
{
int x, y;
+ E_Border *cbd = NULL;
if (e_config->disable_all_pointer_warps) return 0;
/* 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)
ecore_x_pointer_xy_get(bd->zone->container->win, &x, &y);
if ((x >= bd->x) && (x <= (bd->x + bd->w)) &&
(y >= bd->y) && (y <= (bd->y + bd->h)))
- return 0;
+ {
+ cbd = _e_border_under_pointer_helper(bd->desk, bd, x, y);
+ if (cbd == bd) return 0;
+ }
warp_to_x = bd->x + (bd->w / 2);
if (warp_to_x < (bd->zone->x + 1))
@@ -10337,6 +10345,15 @@ e_border_pointer_warp_to_center(E_Border *bd)
else if (warp_to_y > (bd->zone->y + bd->zone->h))
warp_to_y = (bd->zone->y + bd->zone->h + bd->y) / 2;
+ /* TODO: handle case where another border is over the exact center,
+ * find a place where the requested border is not overlapped?
+ *
+ if (!cbd) cbd = _e_border_under_pointer_helper(bd->desk, bd, x, y);
+ if (cbd != bd)
+ {
+ }
+ */
+
warp_to = 1;
warp_to_win = bd->zone->container->win;
ecore_x_pointer_xy_get(bd->zone->container->win, &warp_x[0], &warp_y[0]);