summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2012-04-11 08:17:25 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2012-04-26 13:35:00 +1000
commitacb74b9b36b55d4f80d85fd6a2790b7c72e197a5 (patch)
treebb8403f3df23a64edcac444e9b0b0b9115c1e517
parent0dea2b1c935ed4c80621e7f5d6fa5193ae09187a (diff)
When deactivating an explicit pointer grab, reject all grabs on touches
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@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 6ca30cb33e829b4edd01822367e44ffe6f0951b0)
-rw-r--r--dix/events.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/dix/events.c b/dix/events.c
index 30e335695..72829c33e 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1472,6 +1472,8 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
DeviceIntPtr dev;
Bool wasImplicit = (mouse->deviceGrab.fromPassiveGrab &&
mouse->deviceGrab.implicitGrab);
+ XID grab_resource = grab->resource;
+ int i;
TouchRemovePointerGrab(mouse);
@@ -1496,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);
+ }
}
/**