diff options
author | Tudor Brindus <me@tbrindus.ca> | 2020-04-19 19:02:30 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-04-22 17:22:40 +0200 |
commit | d88460f716939ae3340794a7bf1ba653b51ddb14 (patch) | |
tree | e56aa5259207dbfe9c06dc302d32300a2114c4fe /sway/input/cursor.c | |
parent | Restrict relative output transforms to runtime changes (diff) | |
download | sway-d88460f716939ae3340794a7bf1ba653b51ddb14.tar.gz sway-d88460f716939ae3340794a7bf1ba653b51ddb14.tar.zst sway-d88460f716939ae3340794a7bf1ba653b51ddb14.zip |
input/cursor: correctly send tablet_v2 up event when over non-v2 surface
If we started holding the tool tip down on a surface that accepts tablet
v2, we should notify that surface if it gets released over a surface
that doesn't support v2.
Since GTK supports tablet v2, this fixes the common case of starting a
drag over a GTK surface (e.g. scrollbar) and releasing it outside (e.g.
over the gaps between sway containers, or in a terminal).
Refs #5230.
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r-- | sway/input/cursor.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 69660945..02994752 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -603,6 +603,13 @@ static void handle_tool_tip(struct wl_listener *listener, void *data) { | |||
603 | &surface, &sx, &sy); | 603 | &surface, &sx, &sy); |
604 | 604 | ||
605 | if (!surface || !wlr_surface_accepts_tablet_v2(tablet_v2, surface)) { | 605 | if (!surface || !wlr_surface_accepts_tablet_v2(tablet_v2, surface)) { |
606 | // If we started holding the tool tip down on a surface that accepts tablet | ||
607 | // v2, we should notify that surface if it gets released over a surface that | ||
608 | // doesn't support v2. | ||
609 | if (event->state == WLR_TABLET_TOOL_TIP_UP) { | ||
610 | wlr_tablet_v2_tablet_tool_notify_up(sway_tool->tablet_v2_tool); | ||
611 | } | ||
612 | |||
606 | dispatch_cursor_button(cursor, event->device, event->time_msec, | 613 | dispatch_cursor_button(cursor, event->device, event->time_msec, |
607 | BTN_LEFT, event->state == WLR_TABLET_TOOL_TIP_DOWN ? | 614 | BTN_LEFT, event->state == WLR_TABLET_TOOL_TIP_DOWN ? |
608 | WLR_BUTTON_PRESSED : WLR_BUTTON_RELEASED); | 615 | WLR_BUTTON_PRESSED : WLR_BUTTON_RELEASED); |