From: Carlos Garnacho Date: Wed, 5 Jul 2023 14:24:03 +0000 (+0200) Subject: gdk/wayland: Switch behavior of BTN_STYLUS/STYLUS2 as middle/right click X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~70^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e28ff79bec53ecd56885390ba4a66019cde598c6;p=gtk4.git 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. Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5935 --- diff --git a/gdk/wayland/gdkseat-wayland.c b/gdk/wayland/gdkseat-wayland.c index 03acdd5450..b284388f62 100644 --- a/gdk/wayland/gdkseat-wayland.c +++ b/gdk/wayland/gdkseat-wayland.c @@ -3064,9 +3064,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