[PATCH xserver 7/8] dix: Handle GenericEvents with the "send event" flag
carlos at lanedo.com
carlos at lanedo.com
Tue Oct 5 09:02:47 PDT 2010
From: Carlos Garnacho <carlosg at gnome.org>
This patch is necessary so the server dispatches correctly GenericEvents
sent through xGESendEventReq.
---
dix/events.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dix/events.c b/dix/events.c
index e6aa967..c57ed26 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -181,7 +181,7 @@ typedef const char *string;
(!((event)->u.u.type & EXTENSION_EVENT_BASE) && \
(event)->u.u.type != GenericEvent)
#define XI2_EVENT(event) \
- (((event)->u.u.type == GenericEvent) && \
+ ((((event)->u.u.type & 0x7f) == GenericEvent) && \
((xGenericEvent*)(event))->extension == IReqCode)
/**
@@ -418,7 +418,7 @@ static Mask filters[MAXDEVICES][128] = {
Mask
GetEventFilter(DeviceIntPtr dev, xEvent *event)
{
- if (event->u.u.type != GenericEvent)
+ if ((event->u.u.type & 0x7f) != GenericEvent)
return filters[dev ? dev->id : 0][event->u.u.type];
else if (XI2_EVENT(event))
return (1 << (((xXIDeviceEvent*)event)->evtype % 8));
@@ -5676,14 +5676,14 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events)
* makes things easier for me right now. (whot) */
for (i = 1; i < count; i++)
{
- if (events[i].u.u.type == GenericEvent)
+ if ((events[i].u.u.type & 0x7f) == GenericEvent)
{
ErrorF("[dix] TryClientEvents: Only one GenericEvent at a time.\n");
return;
}
}
- if (events->u.u.type == GenericEvent)
+ if ((events->u.u.type & 0x7f) == GenericEvent)
{
eventlength += ((xGenericEvent*)events)->length * 4;
}
--
1.7.0.4
More information about the xorg-devel
mailing list