diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-05-21 11:16:37 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-05-22 15:44:57 +1000 |
commit | c9df51b070377ca33e48644dbc842b6e3dfb2975 (patch) | |
tree | eab8b6825c45d0b58af11e123c39e45bc7b3dfbb /xkb | |
parent | ebe45e1a72a81ad22413e5d0514869b3e45a69b7 (diff) |
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>
Diffstat (limited to 'xkb')
-rw-r--r-- | xkb/xkbAccessX.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c index 9bf87142a..88d5d9087 100644 --- a/xkb/xkbAccessX.c +++ b/xkb/xkbAccessX.c @@ -726,7 +726,7 @@ DeviceEvent *event = (DeviceEvent*)ev; COND_WRAP_PROCESS_INPUT_PROC(mouse, xkbPrivPtr, backupproc, xkbUnwrapProc); - xkbi->state.ptr_buttons = mouse->button->state; + xkbi->state.ptr_buttons = (mouse->button) ? mouse->button->state : 0; /* clear any latched modifiers */ if ( xkbi->state.latched_mods && (event->type == ET_ButtonRelease) ) { |