diff options
Diffstat (limited to 'xorg-server/dix/events.c')
-rw-r--r-- | xorg-server/dix/events.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c index 85c8f9abc..b5c88802c 100644 --- a/xorg-server/dix/events.c +++ b/xorg-server/dix/events.c @@ -1131,11 +1131,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 @@ -1145,14 +1146,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 |