summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2015-10-19 11:46:41 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2015-10-19 12:54:08 +1000
commit380861589690bcbe8b04b7a2c23b5dd5d10c4bf8 (patch)
tree9d21b1142faae18d18e2c1fdfeb52b3b436ecc13
parentf180dff710dc54d00e0e26b84de053151f8f207e (diff)
Don't use raw serial numbers in XIEvents
cookie->serial is an Xlib contoction, provided by _XSetLastRequestRead(). This serial may be different to the raw serial number from the wire protocol. This causes issues when the raw serial is used to e.g. compare the event to other non-XI events. Use the cookie's serial number instead. https://bugzilla.gnome.org/show_bug.cgi?id=756649 See also https://bugs.freedesktop.org/show_bug.cgi?id=64687 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/XExtInt.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/XExtInt.c b/src/XExtInt.c
index 672d69a..a35fcc6 100644
--- a/src/XExtInt.c
+++ b/src/XExtInt.c
@@ -1521,7 +1521,7 @@ wireToDeviceEvent(xXIDeviceEvent *in, XGenericEventCookie* cookie)
out = next_block(&ptr_lib, sizeof(XIDeviceEvent));
out->display = cookie->display;
out->type = in->type;
- out->serial = in->sequenceNumber;
+ out->serial = cookie->serial;
out->extension = in->extension;
out->evtype = in->evtype;
out->send_event = ((in->type & 0x80) != 0);
@@ -1794,7 +1794,7 @@ wireToDeviceChangedEvent(xXIDeviceChangedEvent *in, XGenericEventCookie *cookie)
cookie->data = out = malloc(sizeof(XIDeviceChangedEvent) + len);
out->type = in->type;
- out->serial = in->sequenceNumber;
+ out->serial = cookie->serial;
out->display = cookie->display;
out->extension = in->extension;
out->evtype = in->evtype;
@@ -1827,7 +1827,7 @@ wireToHierarchyChangedEvent(xXIHierarchyEvent *in, XGenericEventCookie *cookie)
out->info = (XIHierarchyInfo*)&out[1];
out->display = cookie->display;
out->type = in->type;
- out->serial = in->sequenceNumber;
+ out->serial = cookie->serial;
out->extension = in->extension;
out->evtype = in->evtype;
out->send_event = ((in->type & 0x80) != 0);
@@ -1868,7 +1868,7 @@ wireToRawEvent(XExtDisplayInfo *info, xXIRawEvent *in, XGenericEventCookie *cook
out = next_block(&ptr, sizeof(XIRawEvent));
out->type = in->type;
- out->serial = in->sequenceNumber;
+ out->serial = cookie->serial;
out->display = cookie->display;
out->extension = in->extension;
out->evtype = in->evtype;
@@ -1919,7 +1919,7 @@ wireToEnterLeave(xXIEnterEvent *in, XGenericEventCookie *cookie)
out->buttons.mask = (unsigned char*)&out[1];
out->type = in->type;
- out->serial = in->sequenceNumber;
+ out->serial = cookie->serial;
out->display = cookie->display;
out->extension = in->extension;
out->evtype = in->evtype;
@@ -1962,7 +1962,7 @@ wireToPropertyEvent(xXIPropertyEvent *in, XGenericEventCookie *cookie)
cookie->data = out;
out->type = in->type;
- out->serial = in->sequenceNumber;
+ out->serial = cookie->serial;
out->extension = in->extension;
out->evtype = in->evtype;
out->send_event = ((in->type & 0x80) != 0);
@@ -1983,7 +1983,7 @@ wireToTouchOwnershipEvent(xXITouchOwnershipEvent *in,
cookie->data = out;
out->type = in->type;
- out->serial = in->sequenceNumber;
+ out->serial = cookie->serial;
out->display = cookie->display;
out->extension = in->extension;
out->evtype = in->evtype;
@@ -2011,7 +2011,7 @@ wireToBarrierEvent(xXIBarrierEvent *in, XGenericEventCookie *cookie)
out->display = cookie->display;
out->type = in->type;
- out->serial = in->sequenceNumber;
+ out->serial = cookie->serial;
out->extension = in->extension;
out->evtype = in->evtype;
out->send_event = ((in->type & 0x80) != 0);