[PATCH libXi] Mark sourceid in Raw events as bug and force to 0..

Peter Hutterer peter.hutterer at who-t.net
Sun Feb 13 14:57:42 PST 2011


The protocol does not provide a source ID for raw events, so this value is
always 0. It shouldn't really be there, but the past is so hard to change.

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

diff --git a/include/X11/extensions/XInput2.h b/include/X11/extensions/XInput2.h
index e6c7b30..3fcf083 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;
+    int           sourceid;     /* Bug: Always 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 f96e3ff..5a1bca6 100644
--- a/src/XExtInt.c
+++ b/src/XExtInt.c
@@ -1627,6 +1627,7 @@ 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 */
     out->flags          = in->flags;
 
     out->valuators.mask_len = in->valuators_len * 4;
-- 
1.7.3.5



More information about the xorg-devel mailing list