mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-10 04:40:16 +01:00
dix: fix button state check before changing a button mapping
dev->button->down is a bitmask, not a normal array. Use the helper function to
check, we technically allow the mapping to change after the physical button
has been pressed (but not yet processed yet), so only check BUTTON_PROCESSED.
From XSetPointerMapping(3):
"If any of the buttons to be altered are logically in the down state,
XSetPointerMapping returns MappingBusy, and the mapping is not changed."
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 25d10464f4)
This commit is contained in:
parent
2ea973e12f
commit
47da6e3f47
1 changed files with 2 additions and 1 deletions
|
|
@ -60,7 +60,8 @@ check_butmap_change(DeviceIntPtr dev, CARD8 *map, int len, CARD32 *errval_out,
|
|||
}
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
if (dev->button->map[i + 1] != map[i] && dev->button->down[i + 1])
|
||||
if (dev->button->map[i + 1] != map[i] &&
|
||||
button_is_down(dev, i + 1, BUTTON_PROCESSED))
|
||||
return MappingBusy;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue