79 lines
2.8 KiB
Diff
79 lines
2.8 KiB
Diff
From f93370eed883a8f3593f8cbe5dafbd8dbf2b72e8 Mon Sep 17 00:00:00 2001
|
|
From: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Date: Thu, 28 Feb 2013 11:02:40 +1000
|
|
Subject: [PATCH 19/35] dix: XAllowEvents() on a touch event means accepting it
|
|
|
|
A sync grab is the owner once it gets events. If it doesn't replay the
|
|
event it will get all events from this touch, equivalent to accepting it.
|
|
|
|
If the touch has ended before XAllowEvents() is called, we also now need to
|
|
send the TouchEnd event and clean-up since we won't see anything more from
|
|
this touch.
|
|
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
(cherry picked from commit 5174b1f98204beee79eba74c4cda5f2be0a60a8f)
|
|
---
|
|
dix/events.c | 10 ++++++++++
|
|
dix/touch.c | 14 ++++++++++++++
|
|
include/input.h | 1 +
|
|
3 files changed, 25 insertions(+)
|
|
|
|
diff --git a/dix/events.c b/dix/events.c
|
|
index 2682ecd..7772c0b 100644
|
|
--- a/dix/events.c
|
|
+++ b/dix/events.c
|
|
@@ -1739,6 +1739,16 @@ AllowSome(ClientPtr client, TimeStamp time, DeviceIntPtr thisDev, int newState)
|
|
}
|
|
break;
|
|
}
|
|
+
|
|
+ /* We've unfrozen the grab. If the grab was a touch grab, we're now the
|
|
+ * owner and expected to accept/reject it. Reject == ReplayPointer which
|
|
+ * we've handled in ComputeFreezes() (during DeactivateGrab) above,
|
|
+ * anything else is accept.
|
|
+ */
|
|
+ if (newState != NOT_GRABBED /* Replay */ &&
|
|
+ IsTouchEvent((InternalEvent*)grabinfo->sync.event)) {
|
|
+ TouchAcceptAndEnd(thisDev, grabinfo->sync.event->touchid);
|
|
+ }
|
|
}
|
|
|
|
/**
|
|
diff --git a/dix/touch.c b/dix/touch.c
|
|
index f7112fc..0cbc2eb 100644
|
|
--- a/dix/touch.c
|
|
+++ b/dix/touch.c
|
|
@@ -1102,3 +1102,17 @@ TouchEmitTouchEnd(DeviceIntPtr dev, TouchPointInfoPtr ti, int flags, XID resourc
|
|
GetDixTouchEnd(&event, dev, ti, flags);
|
|
DeliverTouchEvents(dev, ti, &event, resource);
|
|
}
|
|
+
|
|
+void
|
|
+TouchAcceptAndEnd(DeviceIntPtr dev, int touchid)
|
|
+{
|
|
+ TouchPointInfoPtr ti = TouchFindByClientID(dev, touchid);
|
|
+ if (!ti)
|
|
+ return;
|
|
+
|
|
+ TouchListenerAcceptReject(dev, ti, 0, XIAcceptTouch);
|
|
+ if (ti->pending_finish)
|
|
+ TouchEmitTouchEnd(dev, ti, 0, 0);
|
|
+ if (ti->num_listeners <= 1)
|
|
+ TouchEndTouch(dev, ti);
|
|
+}
|
|
diff --git a/include/input.h b/include/input.h
|
|
index 866879b..7eed60b 100644
|
|
--- a/include/input.h
|
|
+++ b/include/input.h
|
|
@@ -591,6 +591,7 @@ extern void TouchEndPhysicallyActiveTouches(DeviceIntPtr dev);
|
|
extern void TouchDeliverDeviceClassesChangedEvent(TouchPointInfoPtr ti,
|
|
Time time, XID resource);
|
|
extern void TouchEmitTouchEnd(DeviceIntPtr dev, TouchPointInfoPtr ti, int flags, XID resource);
|
|
+extern void TouchAcceptAndEnd(DeviceIntPtr dev, int touchid);
|
|
|
|
/* misc event helpers */
|
|
extern Mask GetEventMask(DeviceIntPtr dev, xEvent *ev, InputClientsPtr clients);
|
|
--
|
|
1.8.2.1
|
|
|