summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-11-26 12:23:54 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-01-21 13:45:05 +1000
commite1626674333ef4d67f97d9960f58486c9f6cb11d (patch)
tree2f28178f12446179d103100058346ec4e86ed6ca
parentb72ffcf6ae146feaa08df80e65d293bc3a62331f (diff)
dix: only reject active grabs on ungrab and do it before actually ungrabbing
An active grab ungrabbing is the same as rejecting the grab, since the client is no longer interested in those events. So reject any touch grab, but do so before actually deactivating since we're interested in the TouchEnd for the current grabbing client. A passive grab otoh is _not_ like rejecting a grab, since it deactivates automatically when the touch ends. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit bc1f90a615018c05994fae3e678dd2341256cd82)
-rw-r--r--dix/events.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/dix/events.c b/dix/events.c
index bf6eef2ed..9e0bbb3e8 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1503,11 +1503,20 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
{
GrabPtr grab = mouse->deviceGrab.grab;
DeviceIntPtr dev;
+ Bool wasPassive = mouse->deviceGrab.fromPassiveGrab;
Bool wasImplicit = (mouse->deviceGrab.fromPassiveGrab &&
mouse->deviceGrab.implicitGrab);
XID grab_resource = grab->resource;
int i;
+ /* If an explicit grab was deactivated, we must remove it from the head of
+ * all the touches' listener lists. */
+ for (i = 0; !wasPassive && 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);
+ }
+
TouchRemovePointerGrab(mouse);
mouse->valuator->motionHintWindow = NullWindow;