mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-24 01:40:36 +00:00
input: allow for master pointers to not have a button class.
There's devices (e.g. some barcode readers) that have axes but no buttons. When such a device sends a motion event, the valuator and button class is copied into the master pointer (i.e. removing the button class). So we need a couple of extra sanity checks for the button class to exist. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
ebe45e1a72
commit
c9df51b070
3 changed files with 5 additions and 5 deletions
|
|
@ -996,8 +996,8 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
|
|||
}
|
||||
|
||||
/* State needs to be assembled BEFORE the device is updated. */
|
||||
state = (kbd) ? XkbStateFieldFromRec(&kbd->key->xkbInfo->state) : 0;
|
||||
state |= (mouse) ? (mouse->button->state) : 0;
|
||||
state = (kbd && kbd->key) ? XkbStateFieldFromRec(&kbd->key->xkbInfo->state) : 0;
|
||||
state |= (mouse && mouse->button) ? (mouse->button->state) : 0;
|
||||
|
||||
for (i = 0; mouse && mouse->button && i < mouse->button->numButtons; i++)
|
||||
if (BitIsOn(mouse->button->down, i))
|
||||
|
|
|
|||
Loading…
Reference in a new issue