diff options
Diffstat (limited to 'xorg-server/dix')
-rw-r--r-- | xorg-server/dix/eventconvert.c | 1 | ||||
-rw-r--r-- | xorg-server/dix/events.c | 32 |
2 files changed, 25 insertions, 8 deletions
diff --git a/xorg-server/dix/eventconvert.c b/xorg-server/dix/eventconvert.c index e25f3ee97..878dba576 100644 --- a/xorg-server/dix/eventconvert.c +++ b/xorg-server/dix/eventconvert.c @@ -119,6 +119,7 @@ EventToCore(InternalEvent *event, xEvent *core) core->u.keyButtonPointer.rootX = e->root_x; core->u.keyButtonPointer.rootY = e->root_y; core->u.keyButtonPointer.state = e->corestate; + core->u.keyButtonPointer.root = e->root; EventSetKeyRepeatFlag(core, (e->type == ET_KeyPress && e->key_repeat)); } break; 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 |