diff options
author | Dima Ryazanov <dima@gmail.com> | 2014-12-22 11:35:29 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-12-25 13:31:38 -0800 |
commit | f9e22cefcb9684bf495ada3ec4b0231ab2dc6cff (patch) | |
tree | 4205d9f525b4fad1a2b994e2b2f7d620f4b79290 /hw/xwayland/xwayland-input.c | |
parent | 70a6f65f9e2b26ef7539dcacfcfea927bc1f13fd (diff) |
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 <dima@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw/xwayland/xwayland-input.c')
-rw-r--r-- | hw/xwayland/xwayland-input.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index b8c543ce4..5e204189f 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -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; } |