[PATCH 28/42] dix: add TouchResourceIsOwner helper function

Peter Hutterer peter.hutterer at who-t.net
Wed Dec 14 19:02:05 PST 2011


The first listener in the sequence is the owner of the touch sequence.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 dix/touch.c     |   10 ++++++++++
 include/input.h |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/dix/touch.c b/dix/touch.c
index 44e3aea..6489931 100644
--- a/dix/touch.c
+++ b/dix/touch.c
@@ -613,6 +613,16 @@ TouchGetPointerEventType(const InternalEvent *event)
 
 
 /**
+ * @returns TRUE if the specified grab or selection is the current owner of
+ * the touch sequence.
+ */
+Bool
+TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource)
+{
+    return (ti->listeners[0].listener == resource);
+}
+
+/**
  * Add the resource to this touch's listeners.
  */
 void
diff --git a/include/input.h b/include/input.h
index 85c8f20..ae44a96 100644
--- a/include/input.h
+++ b/include/input.h
@@ -611,6 +611,7 @@ extern Bool TouchEventHistoryAllocate(TouchPointInfoPtr ti);
 extern void TouchEventHistoryFree(TouchPointInfoPtr ti);
 extern void TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev);
 extern void TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource);
+extern Bool TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource);
 extern void TouchAddListener(TouchPointInfoPtr ti, XID resource, enum InputLevel level,
                                      enum TouchListenerType type, enum TouchListenerState state);
 extern Bool TouchRemoveListener(TouchPointInfoPtr ti, XID resource);
-- 
1.7.7.1



More information about the xorg-devel mailing list