[PATCH inputproto multitouch] Cater for clients failing to accept/reject ownership

carlosg at gnome.org carlosg at gnome.org
Wed Aug 31 12:11:10 PDT 2011


From: Carlos Garnacho <carlosg at gnome.org>

The multitouch protocol definition largely assumed well behaved
clients, and had no way to deal with misbehaved ones that wouldn't
claim nor deny ownership on the sequence.

So, introduce the TouchExpired flag, to be used by the server when
forcing touch sequences to expire after being unhandled for some
time. The correct behavior is also emphasized in the spec.

Signed-off-by: Carlos Garnacho <carlosg at gnome.org>
---
 XI2.h              |    1 +
 specs/XI2proto.txt |    9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/XI2.h b/XI2.h
index 2aea35e..7a38ede 100644
--- a/XI2.h
+++ b/XI2.h
@@ -160,6 +160,7 @@
 #define XITouchPendingEnd                       (1 << 16)
 #define XITouchCanceled                         (1 << 17)
 #define XITouchResumed                          (1 << 18)
+#define XITouchExpired                          (1 << 19)
 
 /* Touch modes */
 #define XIDirectTouch                           1
diff --git a/specs/XI2proto.txt b/specs/XI2proto.txt
index 2a96162..9bf53d7 100644
--- a/specs/XI2proto.txt
+++ b/specs/XI2proto.txt
@@ -310,7 +310,10 @@ has not accepted or rejected ownership, the client receives a TouchUpdate event
 with the TouchPendingEnd flag set, but must still accept or reject the sequence
 nonetheless. If the owner rejects the touch sequence, the server will still
 attempt to exhaust all other passive grabs and/or event selections looking for
-a final owner.
+a final owner. If the client fails to either accept or reject ownership on the
+touch sequence, the server may finally dispose it after a reasonable timespan,
+in that case the last owner of the sequence will receive a TouchEnd event with
+the TouchExpired flag set.
 
 Clients may opt for touch events to be delivered before they become the
 owner of the touch sequence. In this case, the logical state of the device (as
@@ -343,7 +346,9 @@ TouchUpdate events will be sent for this sequence. If the current owner
 accepts the sequence, the client receives a TouchEnd event. Otherwise, if
 the current owner rejects the sequence, the client may become 
 the owner of the touch sequence and receive a TouchOwnership event and a
-TouchEnd event.
+TouchEnd event. Clients are recommended to either accept or reject the
+touch sequence after receiving a TouchUpdate with TouchPendingEnd at the
+latest.
 
 [[multitouch-device-modes]]
 Touch device modes
-- 
1.7.6



More information about the xorg-devel mailing list