Skip to content

Commit

Permalink
xwayland: Correct off-by-one error in tablet button numbering
Browse files Browse the repository at this point in the history
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: 773b047 ("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>
  • Loading branch information
jigpu authored and whot committed Jun 12, 2017
1 parent d5e2f27 commit fbc9814
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hw/xwayland/xwayland-input.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit fbc9814

Please sign in to comment.