[PATCH weston] Fix "Back", "Forward", and other special mouse buttons in the X11 compositor.

Dima Ryazanov dima at gmail.com
Mon Dec 22 11:51:05 PST 2014


They're off by 4 because of the scroll buttons.

(However, if you test them in XWayland, they'll appear to work because
XWayland has the same bug; see
http://lists.x.org/archives/xorg-devel/2014-December/044987.html)

Signed-off-by: Dima Ryazanov <dima at gmail.com>
---
 src/compositor-x11.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/compositor-x11.c b/src/compositor-x11.c
index 29f2119..af9de6f 100644
--- a/src/compositor-x11.c
+++ b/src/compositor-x11.c
@@ -1015,7 +1015,10 @@ x11_compositor_deliver_button_event(struct x11_compositor *c,
 
 	switch (button_event->detail) {
 	default:
-		button = button_event->detail + BTN_LEFT - 1;
+		button = button_event->detail + BTN_SIDE - 8;
+		break;
+	case 1:
+		button = BTN_LEFT;
 		break;
 	case 2:
 		button = BTN_MIDDLE;
-- 
2.1.0



More information about the wayland-devel mailing list