Xi: if a passive async grab is activated from an emulated touch, accept
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 28 Feb 2013 05:28:46 +0000 (15:28 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Fri, 10 May 2013 04:26:15 +0000 (14:26 +1000)
Async grabs cannot replay events, they cannot reject, so we can do an early
accept here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Xi/exevents.c

index b1df0cb..0f37d6b 100644 (file)
@@ -1848,8 +1848,14 @@ DeliverTouchBeginEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
         listener->type == LISTENER_POINTER_GRAB) {
         rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win,
                                        grab, xi2mask);
-        if (rc == Success)
+        if (rc == Success) {
             listener->state = LISTENER_IS_OWNER;
+            /* async grabs cannot replay, so automatically accept this touch */
+            if (dev->deviceGrab.grab &&
+                dev->deviceGrab.fromPassiveGrab &&
+                dev->deviceGrab.grab->pointerMode == GrabModeAsync)
+                ActivateEarlyAccept(dev, ti);
+        }
         goto out;
     }