[PATCH libXi] Set the raw event's sourceid in XI 2.1 (#34240)

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


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

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 include/X11/extensions/XInput2.h |    2 +-
 src/XExtInt.c                    |    7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/X11/extensions/XInput2.h b/include/X11/extensions/XInput2.h
index 3fcf083..ccc743e 100644
--- a/include/X11/extensions/XInput2.h
+++ b/include/X11/extensions/XInput2.h
@@ -242,7 +242,7 @@ typedef struct {
     int           evtype;       /* XI_RawKeyPress, XI_RawKeyRelease, etc. */
     Time          time;
     int           deviceid;
-    int           sourceid;     /* Bug: Always 0. https://bugs.freedesktop.org//show_bug.cgi?id=34240 */
+    int           sourceid;     /* Bug: Always 0 in XI 2.0. https://bugs.freedesktop.org//show_bug.cgi?id=34240 */
     int           detail;
     int           flags;
     XIValuatorState valuators;
diff --git a/src/XExtInt.c b/src/XExtInt.c
index 32df6f9..7d5f583 100644
--- a/src/XExtInt.c
+++ b/src/XExtInt.c
@@ -1636,7 +1636,12 @@ wireToRawEvent(xXIRawEvent *in, XGenericEventCookie *cookie)
     out->time           = in->time;
     out->detail         = in->detail;
     out->deviceid       = in->deviceid;
-    out->sourceid       = 0; /* https://bugs.freedesktop.org/show_bug.cgi?id=34240 */
+    /* https://bugs.freedesktop.org/show_bug.cgi?id=34240 */
+#if (defined XI_2_Major) && (defined XI_2_1_Minor)
+    out->sourceid       = in->sourceid;
+#else
+    out->sourceid       = 0;
+#endif
     out->flags          = in->flags;
 
     out->valuators.mask_len = in->valuators_len * 4;
-- 
1.7.6



More information about the xorg-devel mailing list