summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-12-03 08:36:45 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-12-11 14:00:50 +1000
commit23394c7fea0f5c33333198c87ecfecc9f6c6a791 (patch)
treebdb2bb285f240ae47746e7e80b581f2c2d358cf0 /Xi
parentc1d30b5bd7f90e68bc38404fd0cc32578d6d3018 (diff)
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 <http://bugs.freedesktop.org/show_bug.cgi?id=71878> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/exevents.c3
1 files changed, 2 insertions, 1 deletions
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);