[PATCH 5/5] barriers: Add hack for subpixel pointer motion

Jasper St. Pierre jstpierre at mecheye.net
Tue Nov 20 11:50:45 PST 2012


From: "Jasper St. Pierre" <jstpierre at mecheye.net>

Subpixel pointer motion is truncated to (0, 0). While this
means that the pointer doesn't move at all, it also means
that all currently "touched" barriers will become "untouched".

Until we add an explicit hook for pointer barrier constrainment,
just filter out these subpixel motion events.

Signed-off-by: Jasper St. Pierre <jstpierre at mecheye.net>
---
 Xi/xibarriers.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c
index 85a9e64..2ee8536 100644
--- a/Xi/xibarriers.c
+++ b/Xi/xibarriers.c
@@ -350,6 +350,12 @@ BarrierConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode,
          * destination, again finding the nearest barrier and clamping.
          */
         dir = barrier_get_direction(ox, oy, *x, *y);
+
+        /* HACK for "move 0, 0": subpixel pointer motion. */
+        if (dir == 0) {
+            goto out;
+        }
+
         dx = unclamped_x - ox;
         dy = unclamped_y - oy;
 
@@ -408,6 +414,7 @@ BarrierConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode,
         }
     }
 
+ out:
     if (cs->ConstrainCursorHarder) {
         screen->ConstrainCursorHarder = cs->ConstrainCursorHarder;
         screen->ConstrainCursorHarder(dev, screen, mode, x, y, unclamped_x, unclamped_y);
-- 
1.8.0



More information about the xorg-devel mailing list