|
|
0c8e57 |
From edcc95e914079485b7d693cecbfc436d084ad47d Mon Sep 17 00:00:00 2001
|
|
|
0c8e57 |
From: Jason Gerecke <killertofu@gmail.com>
|
|
|
0c8e57 |
Date: Fri, 9 Jun 2017 16:02:06 -0700
|
|
|
0c8e57 |
Subject: [PATCH xserver 11/12] xwayland: Correct off-by-one error in tablet
|
|
|
0c8e57 |
button numbering
|
|
|
0c8e57 |
|
|
|
0c8e57 |
The 'tablet_tool_frame' function treats the button masks as though they
|
|
|
0c8e57 |
are zero-indexed, but 'tablet_tool_button_state' treats them as one-
|
|
|
0c8e57 |
indexed. The result is that an e.g. middle click event recieved from
|
|
|
0c8e57 |
Wayland will be sent from the X server as a right-click instead.
|
|
|
0c8e57 |
|
|
|
0c8e57 |
Fixes: 773b04748d0 ("xwayland: handle button events after motion events")
|
|
|
0c8e57 |
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
|
|
|
0c8e57 |
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
0c8e57 |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
0c8e57 |
(cherry picked from commit fbc9814975fe82be25becf1a55d4f8d34298a956)
|
|
|
0c8e57 |
---
|
|
|
0c8e57 |
hw/xwayland/xwayland-input.c | 4 ++--
|
|
|
0c8e57 |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
0c8e57 |
|
|
|
0c8e57 |
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
|
|
|
0c8e57 |
index ee932be60..a6d7d9356 100644
|
|
|
0c8e57 |
--- a/hw/xwayland/xwayland-input.c
|
|
|
0c8e57 |
+++ b/hw/xwayland/xwayland-input.c
|
|
|
0c8e57 |
@@ -1626,9 +1626,9 @@ tablet_tool_button_state(void *data, struct zwp_tablet_tool_v2 *tool,
|
|
|
0c8e57 |
BUG_RETURN(xbtn >= 8 * sizeof(*mask));
|
|
|
0c8e57 |
|
|
|
0c8e57 |
if (state)
|
|
|
0c8e57 |
- SetBit(mask, xbtn);
|
|
|
0c8e57 |
+ SetBit(mask, xbtn - 1);
|
|
|
0c8e57 |
else
|
|
|
0c8e57 |
- ClearBit(mask, xbtn);
|
|
|
0c8e57 |
+ ClearBit(mask, xbtn - 1);
|
|
|
0c8e57 |
|
|
|
0c8e57 |
xwl_seat->xwl_screen->serial = serial;
|
|
|
0c8e57 |
}
|
|
|
0c8e57 |
--
|
|
|
0c8e57 |
2.13.5
|
|
|
0c8e57 |
|