gdk/wayland: Switch behavior of BTN_STYLUS/STYLUS2 as middle/right click

This mapping of stylus evdev input event codes into GDK button numbers
makes gdk/wayland inconsistent with gdk/x11, so depending on the backend
the same button middle-click pastes or right-click pops up menus.

Make the wayland backend consistent with X11, so that a GNOME wayland
session gets these buttons consistently mapped across all kinds of
clients.

(cherry-picked from commit e28ff79bec)
This commit is contained in:
Carlos Garnacho
2023-07-05 16:24:03 +02:00
parent e1f3ce5cce
commit e205bdaa89

View File

@@ -3963,9 +3963,9 @@ tablet_tool_handle_button (void *data,
tablet->pointer_info.press_serial = serial;
if (button == BTN_STYLUS)
n_button = GDK_BUTTON_SECONDARY;
else if (button == BTN_STYLUS2)
n_button = GDK_BUTTON_MIDDLE;
else if (button == BTN_STYLUS2)
n_button = GDK_BUTTON_SECONDARY;
else if (button == BTN_STYLUS3)
n_button = 8; /* Back */
else