diff options
Diffstat (limited to 'xkb/xkbAccessX.c')
-rw-r--r-- | xkb/xkbAccessX.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c index 88d5d9087..f0f757818 100644 --- a/xkb/xkbAccessX.c +++ b/xkb/xkbAccessX.c @@ -687,21 +687,28 @@ void ProcessPointerEvent( InternalEvent *ev, DeviceIntPtr mouse) { -DeviceIntPtr dev = GetPairedDevice(mouse); -XkbSrvInfoPtr xkbi = dev->key->xkbInfo; +DeviceIntPtr dev; +XkbSrvInfoPtr xkbi = NULL; unsigned changed = 0; ProcessInputProc backupproc; xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(mouse); DeviceEvent *event = (DeviceEvent*)ev; - xkbi->shiftKeyCount = 0; - xkbi->lastPtrEventTime= event->time; + dev = (IsMaster(mouse) || mouse->u.master) ? GetMaster(mouse, MASTER_KEYBOARD) : mouse; + + if (dev && dev->key) + { + xkbi = dev->key->xkbInfo; + xkbi->shiftKeyCount = 0; + xkbi->lastPtrEventTime= event->time; + } if (event->type == ET_ButtonPress) { changed |= XkbPointerButtonMask; } else if (event->type == ET_ButtonRelease) { - xkbi->lockedPtrButtons&= ~(1 << (event->detail.key & 0x7)); + if (xkbi) + xkbi->lockedPtrButtons&= ~(1 << (event->detail.key & 0x7)); changed |= XkbPointerButtonMask; } @@ -726,6 +733,9 @@ DeviceEvent *event = (DeviceEvent*)ev; COND_WRAP_PROCESS_INPUT_PROC(mouse, xkbPrivPtr, backupproc, xkbUnwrapProc); + if (!xkbi) + return; + xkbi->state.ptr_buttons = (mouse->button) ? mouse->button->state : 0; /* clear any latched modifiers */ |