[PATCH 03/24] Xi: if we delivered a TouchEnd to a passive grab, end it
Peter Hutterer
peter.hutterer at who-t.net
Thu May 9 22:30:38 PDT 2013
ef64b5ee97099618cf2e2cbbd3e471095695ae24 (which introduced the
TOUCH_CLIENT_ID check) has a wrong assumption that generated touch events
(TOUCH_CLIENT_ID) should not terminate passive grabs.
This is untrue, a TouchEnd may be generated in response to a TouchReject
higher up. If we _deliver_ an event to a client, terminate the passive grab.
This requires us to count the actually delivered events too (first hunk).
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
Xi/exevents.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/Xi/exevents.c b/Xi/exevents.c
index fae747c..0cadf43 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1417,7 +1417,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
}
if (!deliveries)
- DeliverOneGrabbedEvent(ptrev, dev, grab->grabtype);
+ deliveries = DeliverOneGrabbedEvent(ptrev, dev, grab->grabtype);
/* We must accept the touch sequence once a pointer listener has
* received one event past ButtonPress. */
@@ -1425,8 +1425,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
!(ev->device_event.flags & TOUCH_CLIENT_ID))
TouchListenerAcceptReject(dev, ti, 0, XIAcceptTouch);
- if (ev->any.type == ET_TouchEnd &&
- !(ev->device_event.flags & TOUCH_CLIENT_ID) &&
+ if (deliveries && ev->any.type == ET_TouchEnd &&
!dev->button->buttonsDown &&
dev->deviceGrab.fromPassiveGrab && GrabIsPointerGrab(grab)) {
(*dev->deviceGrab.DeactivateGrab) (dev);
--
1.8.1.4
More information about the xorg-devel
mailing list