[PATCH inputproto] Add sourceid to RawEvents (#34420)

Peter Hutterer peter.hutterer at who-t.net
Thu Jul 28 18:05:26 PDT 2011


RawEvents in XI2 do not provide the source ID. The libXi headers however do
and it is currently always 0. Given that the sourceid may be useful for
some clients, send it down the wire.

X.Org Bug 34420 <http://bugs.freedesktop.org/show_bug.cgi?id=34420>

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 XI2proto.h         |    2 +-
 specs/XI2proto.txt |    7 +++++++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/XI2proto.h b/XI2proto.h
index 84574a5..8977e87 100644
--- a/XI2proto.h
+++ b/XI2proto.h
@@ -902,7 +902,7 @@ typedef struct
     uint16_t    deviceid;
     Time        time;
     uint32_t    detail;
-    uint16_t    pad0;
+    uint16_t    sourceid;               /**< The source device (XI 2.1) */
     uint16_t    valuators_len;          /**< Length of trailing valuator
                                              mask in 4 byte units */
     uint32_t    flags;                  /**< ::XIKeyRepeat */
diff --git a/specs/XI2proto.txt b/specs/XI2proto.txt
index fdbcc72..0635e70 100644
--- a/specs/XI2proto.txt
+++ b/specs/XI2proto.txt
@@ -1620,6 +1620,7 @@ Modifier state in mods is detailed as follows:
         RawEvent
             EVENTHEADER
             detail:                    CARD32
+            sourceid*:                 DEVICEID
             flags:                     DEVICEEVENTFLAGS
             valuators_len:             CARD16
             valuators:                 SETofVALUATORMASK
@@ -1627,6 +1628,8 @@ Modifier state in mods is detailed as follows:
             axisvalues_raw:            LISTofFP3232
     └───
 
+    * since XI 2.1
+
 A RawEvent provides the information provided by the driver to the
 client. RawEvent provides both the raw data as supplied by the driver and
 transformed data as used in the server. Transformations include, but are
@@ -1640,10 +1643,14 @@ grabbed by another client.
 Clients supporting XI 2.1 or later receive raw events at all times, even
 when the device is grabbed by another client.
 
+
     eventtype
         The type of event that occured on the device.
     detail
         The button number or keycode.
+    sourceid
+        The source device that originally generated the event. The sourceid
+        is undefined for clients supporting XI 2.0.
     flags
         Flags as described in DeviceEvent.
     valuators_len
-- 
1.7.6



More information about the xorg-devel mailing list