[PATCH] Xi: ungrab device when releasing a passive grab without ButtonReleaseMask (#71878)

Peter Hutterer peter.hutterer at who-t.net
Mon Dec 2 15:02:59 PST 2013


If a touch triggers an async button grab and that grab does not have the
ButtonReleaseMask set, the TouchEnd is never delivered, deliveries is 0  and
the grab is never deactivated.

If the grab is pointer async and keyboard sync, the keyboard events are stuck
in EnqueueEvent until some other pointer event terminates the grab.

Change this to check for the number of listeners. If we're about to deliver a
TouchEnd to a passive pointer grab, the number of listeners is already 1 -
pointer grabs always accept so other listeners were removed.

X.Org Bug 71878 <http://bugs.freedesktop.org/show_bug.cgi?id=71878>

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 Xi/exevents.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 5e1d3e0..dff0a92 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1413,7 +1413,8 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
                 !(ev->device_event.flags & TOUCH_CLIENT_ID))
                 TouchListenerAcceptReject(dev, ti, 0, XIAcceptTouch);
 
-            if (deliveries && ev->any.type == ET_TouchEnd &&
+            if (ev->any.type == ET_TouchEnd &&
+                ti->num_listeners == 1 &&
                 !dev->button->buttonsDown &&
                 dev->deviceGrab.fromPassiveGrab && GrabIsPointerGrab(grab)) {
                 (*dev->deviceGrab.DeactivateGrab) (dev);
-- 
1.8.3.1



More information about the xorg-devel mailing list