diff options
author | Jason Gerecke <killertofu@gmail.com> | 2017-10-10 09:17:43 -0700 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2018-01-30 21:32:07 +0100 |
commit | 6fd6ff2ea10f00ff27a3df638a135f9d7fb02152 (patch) | |
tree | e871ed0367ec82f32232a798d6166201ea0deb75 | |
parent | cb5c739f93a75bd7b2d78e0179bb71f69018c273 (diff) | |
download | gtk+-6fd6ff2ea10f00ff27a3df638a135f9d7fb02152.tar.gz |
wayland: Add support for BTN_STYLUS3
BTN_STYLUS3 is defined by the Linux 4.15 kernel and is sent when the
third button on a stylus is pressed. At the moment, only Wacom's "Pro
Pen 3D" has three stylus buttons. Pressing this button triggers a button
8 event to be sent under X11, so we use the same mapping here.
https://bugzilla.gnome.org/show_bug.cgi?id=790033
-rw-r--r-- | gdk/wayland/gdkdevice-wayland.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index 55cfa89a59..4dde62229f 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -49,6 +49,10 @@ #define BUTTON_BASE (BTN_LEFT - 1) /* Used to translate to 1-indexed buttons */ +#ifndef BTN_STYLUS3 +#define BTN_STYLUS3 0x149 /* Linux 4.15 */ +#endif + typedef struct _GdkWaylandDevicePad GdkWaylandDevicePad; typedef struct _GdkWaylandDevicePadClass GdkWaylandDevicePadClass; @@ -3611,6 +3615,8 @@ tablet_tool_handle_button (void *data, n_button = GDK_BUTTON_SECONDARY; else if (button == BTN_STYLUS2) n_button = GDK_BUTTON_MIDDLE; + else if (button == BTN_STYLUS3) + n_button = 8; /* Back */ else return; |