xfree86: dga needs to use the master keyboard state (#27573)
GetPairedDevice() may not always return the keyboard, resulting in a null-pointer dereference when accessing the XKB state. For floating devices, the GetMaster() returns the device itself. X.Org Bug 27573 <http://bugs.freedesktop.org/show_bug.cgi?id=27573> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Tested-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
parent
758b861447
commit
10de9e8ee3
|
@ -1088,13 +1088,15 @@ DGAProcessPointerEvent (ScreenPtr pScreen, DGAEvent *event, DeviceIntPtr mouse)
|
|||
ButtonClassPtr butc = mouse->button;
|
||||
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
|
||||
DeviceEvent ev;
|
||||
DeviceIntPtr master = GetMaster(mouse, MASTER_KEYBOARD);
|
||||
|
||||
memset(&ev, 0, sizeof(ev));
|
||||
ev.header = ET_Internal;
|
||||
ev.length = sizeof(ev);
|
||||
ev.type = event->subtype;
|
||||
ev.corestate = butc->state;
|
||||
ev.corestate |= XkbStateFieldFromRec(&GetPairedDevice(mouse)->key->xkbInfo->state);
|
||||
if (master && master->key)
|
||||
ev.corestate |= XkbStateFieldFromRec(&master->key->xkbInfo->state);
|
||||
|
||||
UpdateDeviceState(mouse, &ev);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user