summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2017-06-09 16:02:06 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2017-06-12 10:47:44 +1000
commitfbc9814975fe82be25becf1a55d4f8d34298a956 (patch)
tree8b01d31f5f0f4aa90b99eeba4fdc2407162d4bd9 /hw
parentd5e2f271ad93e50412ff3605fb25cb9622f437e0 (diff)
xwayland: Correct off-by-one error in tablet button numbering
The 'tablet_tool_frame' function treats the button masks as though they are zero-indexed, but 'tablet_tool_button_state' treats them as one- indexed. The result is that an e.g. middle click event recieved from Wayland will be sent from the X server as a right-click instead. Fixes: 773b04748d0 ("xwayland: handle button events after motion events") Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'hw')
-rw-r--r--hw/xwayland/xwayland-input.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 02fdf6eef..0e5f84f54 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -1620,9 +1620,9 @@ tablet_tool_button_state(void *data, struct zwp_tablet_tool_v2 *tool,
BUG_RETURN(xbtn >= 8 * sizeof(*mask));
if (state)
- SetBit(mask, xbtn);
+ SetBit(mask, xbtn - 1);
else
- ClearBit(mask, xbtn);
+ ClearBit(mask, xbtn - 1);
xwl_seat->xwl_screen->serial = serial;
}