[PATCH inputproto multitouch] Create separate structure for XI 2.2 XIAllowEvents request

Chase Douglas chase.douglas at canonical.com
Wed Sep 14 22:20:24 PDT 2011


The GetReq Xlib macro uses string contatenation of request names to
assign structures and get the appropriate size block from the Xlib
buffer. This means we can't use GetReq with a different struct name than
the original XI 2.0 name.

The only sane way around this seems to be to create a separate struct to
hold the new members of the extended request. Then, GetReqExtra can be
used to get a request set up correctly with extra room on the end for
the extended parameters.

Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
---
 XI2proto.h |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/XI2proto.h b/XI2proto.h
index 2460cf5..37304b9 100644
--- a/XI2proto.h
+++ b/XI2proto.h
@@ -647,10 +647,19 @@ typedef struct {
     uint16_t    deviceid;
     uint8_t     mode;
     uint8_t     pad;
-    uint32_t    touch_id;               /**< Since XI 2.2 */
-    Window      grab_window;            /**< Since XI 2.2 */
 } xXIAllowEventsReq;
-#define sz_xXIAllowEventsReq                   20 /**< Was 12 before XI 2.2 */
+#define sz_xXIAllowEventsReq                   12
+
+
+/**
+ * Allow or replay events on the specified grabbed device (XI 2.2 and on).
+ */
+typedef struct {
+    xXIAllowEventsReq req_2_0;
+    uint32_t    touch_id;
+    Window      grab_window;
+} xXIAllowEventsReq_2_2;
+#define sz_xXIAllowEvents_2_2Req               20
 
 
 /**
-- 
1.7.4.1



More information about the xorg-devel mailing list