diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2021-12-02 16:53:47 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2021-12-02 17:06:35 +0100 |
commit | 9539cc4a93819d2915a3e097940f38d00b5bc202 (patch) | |
tree | d24d9e570a850543311ad74c27d100dee0c08474 | |
parent | 72cf304a861d41aa76d25aa6027a70d36e4261c5 (diff) | |
download | gtk+-9539cc4a93819d2915a3e097940f38d00b5bc202.tar.gz |
gdk/wayland: Unset GDK_BUTTON1_MASK on proximity_in
In some circumstances (e.g. activating with a stylus something that
closes a window), we can receive zwp_tablet_tool.proximity_out without
receiving a zwp_tablet_tool.up beforehand.
In those cases, we are not expecting neither .up nor .button, so
reset the stylus device button modifiers on proximity_out.
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4103
-rw-r--r-- | gdk/wayland/gdkdevice-wayland.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index d0bc73eb97..8a45e911e9 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -3606,6 +3606,10 @@ tablet_tool_handle_proximity_out (void *data, g_object_unref (tablet->pointer_info.focus); tablet->pointer_info.focus = NULL; + tablet->pointer_info.button_modifiers &= + ~(GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK | + GDK_BUTTON4_MASK | GDK_BUTTON5_MASK); + gdk_device_update_tool (tablet->stylus_device, NULL); g_clear_object (&tablet->pointer_info.cursor); } |