summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2012-04-11 08:13:17 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2012-04-26 13:34:59 +1000
commit0dea2b1c935ed4c80621e7f5d6fa5193ae09187a (patch)
tree77923736d3a5779ce620ec687c885ed9f6d94c35
parent2bb2eeb05c973ba410773e380e49c2503a2fe9e6 (diff)
Accept touch sequence for pointer listener after second event delivery
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@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit cacdb9a74065ccba7d50a82e14abdf04b36c5309)
-rw-r--r--Xi/exevents.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 57a75cc51..7ef75ec0b 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1466,6 +1466,12 @@ 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 &&
+ !(ev->device_event.flags & TOUCH_CLIENT_ID))
+ TouchListenerAcceptReject(dev, ti, 0, XIAcceptTouch);
+
if (ev->any.type == ET_TouchEnd &&
!dev->button->buttonsDown &&
dev->deviceGrab.fromPassiveGrab && GrabIsPointerGrab(grab)) {