From 23394c7fea0f5c33333198c87ecfecc9f6c6a791 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 3 Dec 2013 08:36:45 +1000 Subject: Xi: ungrab device when releasing a passive grab without ButtonReleaseMask (#71878) If an 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 Signed-off-by: Peter Hutterer --- Xi/exevents.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Xi') diff --git a/Xi/exevents.c b/Xi/exevents.c index 5e1d3e0a6..dff0a92b0 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); -- cgit v1.2.3