[PATCH 3/5] When deactivating an explicit pointer grab, reject all grabs on touches

Chase Douglas chase.douglas at canonical.com
Wed Apr 11 11:22:12 PDT 2012


Explicit pointer grabs are placed at the head of the touch listener
array for pointer emulated touches. If the grab is deactivated, we must
remove it from all touches for the device.

Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
---
 dix/events.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/dix/events.c b/dix/events.c
index 6bcb5eb..9c39977 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1473,6 +1473,7 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
     DeviceIntPtr dev;
     Bool wasImplicit = (mouse->deviceGrab.fromPassiveGrab &&
                         mouse->deviceGrab.implicitGrab);
+    int i;
 
     TouchRemovePointerGrab(mouse);
 
@@ -1497,6 +1498,15 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
         ReattachToOldMaster(mouse);
 
     ComputeFreezes();
+
+    /* If an explicit grab was deactivated, we must remove it from the head of
+     * all the touches' listener lists. */
+    for (i = 0; mouse->touch && i < mouse->touch->num_touches; i++) {
+        TouchPointInfoPtr ti = mouse->touch->touches + i;
+
+        if (ti->active && TouchResourceIsOwner(ti, grab->resource))
+            TouchListenerAcceptReject(mouse, ti, 0, XIRejectTouch);
+    }
 }
 
 /**
-- 
1.7.9.1



More information about the xorg-devel mailing list