diff options
Diffstat (limited to 'xorg-server/dix')
-rw-r--r-- | xorg-server/dix/devices.c | 8 | ||||
-rw-r--r-- | xorg-server/dix/events.c | 92 |
2 files changed, 38 insertions, 62 deletions
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c index b002150d0..6119dcebb 100644 --- a/xorg-server/dix/devices.c +++ b/xorg-server/dix/devices.c @@ -2020,14 +2020,6 @@ ProcBell(ClientPtr client) return BadValue; } - /* Seems like no keyboard actually has the BellProc set. Returning - * BadDevice (previous code) will make apps crash badly. The man pages - * doesn't say anything about a BadDevice being returned either. - * So just quietly do nothing and pretend everything has worked. - */ - if (!keybd->kbdfeed->BellProc) - return Success; - newpercent = (base * stuff->percent) / 100; if (stuff->percent < 0) newpercent = base + newpercent; diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c index b5c88802c..8af8c5ac7 100644 --- a/xorg-server/dix/events.c +++ b/xorg-server/dix/events.c @@ -1134,8 +1134,6 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device) 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 @@ -1146,27 +1144,12 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device) * the data that GetCurrentRootWindow relies on hasn't been * updated yet. */ - if (ev->any.type == ET_Motion) - ev->device_event.root = - WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id; - - 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); - } + ev->device_event.root = WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id; + eventinfo.event = ev; + eventinfo.device = device; + CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); } if (event->type == ET_Motion) @@ -1431,11 +1414,6 @@ CheckGrabForSyncs(DeviceIntPtr thisDev, Bool thisMode, Bool otherMode) thisDev->deviceGrab.sync.other = NullGrab; } - /* - XXX: Direct slave grab won't freeze the paired master device. - The correct thing to do would be to freeze all SDs attached to the - paired master device. - */ if (IsMaster(thisDev)) { dev = GetPairedDevice(thisDev); @@ -2502,32 +2480,36 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab, if (mask & XI_MASK) { rc = EventToXI(event, &xE, &count); - if (rc == Success && - XaceHook(XACE_SEND_ACCESS, NULL, dev, pWin, xE, count) == Success) - { - filter = GetEventFilter(dev, xE); - FixUpEventFromWindow(dev, xE, pWin, child, FALSE); - deliveries = DeliverEventsToWindow(dev, pWin, xE, count, - filter, grab); - if (deliveries > 0) - goto unwind; - } + if (rc == Success) { + if (XaceHook(XACE_SEND_ACCESS, NULL, dev, pWin, xE, count) == Success) { + filter = GetEventFilter(dev, xE); + FixUpEventFromWindow(dev, xE, pWin, child, FALSE); + deliveries = DeliverEventsToWindow(dev, pWin, xE, count, + filter, grab); + if (deliveries > 0) + goto unwind; + } + } else if (rc != BadMatch) + ErrorF("[dix] %s: XI conversion failed in DDE (%d, %d). Skipping delivery.\n", + dev->name, event->any.type, rc); } /* Core event */ if ((mask & CORE_MASK) && IsMaster(dev) && dev->coreEvents) { rc = EventToCore(event, &core); - if (rc == Success && - XaceHook(XACE_SEND_ACCESS, NULL, dev, pWin, &core, 1) == Success) - { - filter = GetEventFilter(dev, &core); - FixUpEventFromWindow(dev, &core, pWin, child, FALSE); - deliveries = DeliverEventsToWindow(dev, pWin, &core, 1, - filter, grab); - if (deliveries > 0) - goto unwind; - } + if (rc == Success) { + if (XaceHook(XACE_SEND_ACCESS, NULL, dev, pWin, &core, 1) == Success) { + filter = GetEventFilter(dev, &core); + FixUpEventFromWindow(dev, &core, pWin, child, FALSE); + deliveries = DeliverEventsToWindow(dev, pWin, &core, 1, + filter, grab); + if (deliveries > 0) + goto unwind; + } + } else if (rc != BadMatch) + ErrorF("[dix] %s: Core conversion failed in DDE (%d, %d).\n", + dev->name, event->any.type, rc); } if ((deliveries < 0) || (pWin == stopAt) || @@ -3804,14 +3786,16 @@ DeliverFocusedEvent(DeviceIntPtr keybd, InternalEvent *event, WindowPtr window) if (sendCore) { rc = EventToCore(event, &core); - if (rc == Success && - XaceHook(XACE_SEND_ACCESS, NULL, keybd, focus, &core, 1) == Success) - { - FixUpEventFromWindow(keybd, &core, focus, None, FALSE); - deliveries = DeliverEventsToWindow(keybd, focus, &core, 1, - GetEventFilter(keybd, &core), - NullGrab); - } + if (rc == Success) { + if (XaceHook(XACE_SEND_ACCESS, NULL, keybd, focus, &core, 1) == Success) { + FixUpEventFromWindow(keybd, &core, focus, None, FALSE); + deliveries = DeliverEventsToWindow(keybd, focus, &core, 1, + GetEventFilter(keybd, &core), + NullGrab); + } + } else if (rc != BadMatch) + ErrorF("[dix] %s: core conversion failed DFE (%d, %d). Skipping delivery.\n", + keybd->name, event->any.type, rc); } unwind: |