[PATCH libX11 6/8] Handle GenericEvents with the "send event" flag set
carlos at lanedo.com
carlos at lanedo.com
Tue Oct 5 09:01:27 PDT 2010
From: Carlos Garnacho <carlosg at gnome.org>
This patch is necessary so GenericEvents with the 0x80 flag on are delivered
correctly.
---
src/XlibInt.c | 2 +-
src/xcb_io.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/XlibInt.c b/src/XlibInt.c
index e094e7d..6f1ebae 100644
--- a/src/XlibInt.c
+++ b/src/XlibInt.c
@@ -759,7 +759,7 @@ struct stored_event {
Bool
_XIsEventCookie(Display *dpy, XEvent *ev)
{
- return (ev->xcookie.type == GenericEvent &&
+ return ((ev->xcookie.type & 0x7f) == GenericEvent &&
dpy->generic_event_vec[ev->xcookie.extension & 0x7F] != NULL);
}
diff --git a/src/xcb_io.c b/src/xcb_io.c
index 7e685de..be05e08 100644
--- a/src/xcb_io.c
+++ b/src/xcb_io.c
@@ -272,7 +272,7 @@ static void handle_response(Display *dpy, xcb_generic_reply_t *response, Bool in
* xcb_generic_event_t struct uses 4 bytes for internal
* numbering, so we need to shift the trailing data to
* be after the first 32 bytes. */
- if(response->response_type == GenericEvent && ((xcb_ge_event_t *) response)->length)
+ if((response->response_type & 0x7f) == GenericEvent && ((xcb_ge_event_t *) response)->length)
{
xcb_ge_event_t *event = (xcb_ge_event_t *) response;
memmove(&event->full_sequence, &event[1], event->length * 4);
--
1.7.0.4
More information about the xorg-devel
mailing list