[PATCH 2/5] Accept touch sequence for pointer listener after second event delivery
Chase Douglas
chase.douglas at canonical.com
Wed Apr 11 11:22:11 PDT 2012
This is a bit of unimplemented code for touchscreen pointer emulation. A
pointer grabbing client currently never accepts the touch sequence. The
sequence must be accepted once any touch-derived event is irrevocably
delivered to a client.
The first pointer event, derived from a touch begin event, may be caught
in a sync grab and then replayed. This is essentially a revocable
delivery of an event. Thus, we must wait till a non-begin event is
delivered.
Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
---
Xi/exevents.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/Xi/exevents.c b/Xi/exevents.c
index c05c226..50ed21b 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1459,6 +1459,11 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
if (!deliveries)
DeliverOneGrabbedEvent(ptrev, dev, grab->grabtype);
+ /* We must accept the touch sequence once a pointer listener has
+ * received one event past ButtonPress. */
+ if (deliveries && ev->any.type != ET_TouchBegin)
+ TouchListenerAcceptReject(dev, ti, 0, XIAcceptTouch);
+
if (ev->any.type == ET_TouchEnd &&
!dev->button->buttonsDown &&
dev->deviceGrab.fromPassiveGrab && GrabIsPointerGrab(grab)) {
--
1.7.9.1
More information about the xorg-devel
mailing list