Commit f9e22cef authored by Dima Ryazanov's avatar Dima Ryazanov Committed by Keith Packard

Fix "Back", "Forward", and other special mouse buttons in XWayland.

Currently, the indexes are off by 4 because of the scroll buttons.
Signed-off-by: Dima Ryazanov's avatarDima Ryazanov <dima@gmail.com>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
parent 70a6f65f
......@@ -233,6 +233,9 @@ pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial,
xwl_seat->xwl_screen->serial = serial;
switch (button) {
case BTN_LEFT:
index = 1;
break;
case BTN_MIDDLE:
index = 2;
break;
......@@ -240,7 +243,9 @@ pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial,
index = 3;
break;
default:
index = button - BTN_LEFT + 1;
/* Skip indexes 4-7: they are used for vertical and horizontal scroll.
The rest of the buttons go in order: BTN_SIDE becomes 8, etc. */
index = 8 + button - BTN_SIDE;
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment