diff options
author | Eoghan Sherry <ejsherry@gmail.com> | 2010-11-28 16:15:51 -0500 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-12-07 08:07:54 +1000 |
commit | 36b614dedf4ddc428e43ad1542d4f9314f73f60a (patch) | |
tree | 164c03dbf63fedb68cdfa03739d8660521ae6f40 /Xi | |
parent | 31ab9f8860848504df18a8be9d19b817b191e0df (diff) |
Xi: Fix master button update when slave buttons are mapped. #24887
It is currently assumed that an event button delieved to a master device
corresponds to the slave button states. However, the event button is a
logical (mapped) slave button and slave button states correspond to
physical (unmapped) slave buttons. This leads to incorrect update of the
master button state and incorrect events devlivered to clients. Fix the
situation by taking the slave button map into account when querying a
slave button state.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=24887
Signed-off-by: Eoghan Sherry <ejsherry@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/exevents.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index d57265ede..8615fd456 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -870,8 +870,10 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) continue; if (!sd->button) continue; - if (button_is_down(sd, key, BUTTON_PROCESSED)) - return DONT_PROCESS; + for (i = 1; i <= sd->button->numButtons; i++) + if (sd->button->map[i] == key && + button_is_down(sd, i, BUTTON_PROCESSED)) + return DONT_PROCESS; } } set_button_up(device, key, BUTTON_PROCESSED); |