aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix/events.c')
-rw-r--r--xorg-server/dix/events.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c
index 1a78c5499..781cc98e4 100644
--- a/xorg-server/dix/events.c
+++ b/xorg-server/dix/events.c
@@ -1134,11 +1134,12 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
event->type == ET_KeyRelease)
AccessXCancelRepeatKey(device->key->xkbInfo, event->detail.key);
-#if 0
- /* FIXME: I'm broken now. Please fix me. */
if (DeviceEventCallback)
{
DeviceEventInfoRec eventinfo;
+ xEvent *xi_events = NULL;
+ int count;
+
/* The RECORD spec says that the root window field of motion events
* must be valid. At this point, it hasn't been filled in yet, so
* we do it here. The long expression below is necessary to get
@@ -1148,14 +1149,29 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
* the data that GetCurrentRootWindow relies on hasn't been
* updated yet.
*/
- if (xE->u.u.type == DeviceMotionNotify)
- XE_KBPTR.root =
+
+ if (ev->any.type == ET_Motion)
+ ev->device_event.root =
WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id;
- eventinfo.events = xE;
- eventinfo.count = nevents;
- CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo);
+
+ EventToXI(ev, &xi_events, &count);
+
+ eventinfo.events = (xEventPtr)xi_events;
+ eventinfo.count = count;
+ CallCallbacks(&DeviceEventCallback, (pointer) & eventinfo);
+ xfree(xi_events);
+
+ if (IsMaster(device))
+ {
+ xEvent core;
+ EventToCore(ev, &core);
+ eventinfo.events = (xEventPtr)&core;
+ eventinfo.count = 1;
+ CallCallbacks(&DeviceEventCallback, (pointer) & eventinfo);
+ }
+
}
-#endif
+
if (event->type == ET_Motion)
{
#ifdef PANORAMIX