summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2012-04-11 08:13:17 -0700
committerChase Douglas <chase.douglas@ubuntu.com>2012-04-18 13:58:39 -0700
commitcacdb9a74065ccba7d50a82e14abdf04b36c5309 (patch)
treee21cfe405e4867cfb6b6951793afb4dfc7c0aaac /Xi
parent447fe7a1a72513aa68145962c47894242c589cc9 (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>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/exevents.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index ab2f044d9..4629df360 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)) {