diff options
author | 2020-04-25 22:12:59 -0400 | |
---|---|---|
committer | 2020-05-01 11:00:49 +0200 | |
commit | 2913f39dcb58997ab055465154d7c7b287da10c7 (patch) | |
tree | f8fee0fba77f9eab3d3a4348cd8ddf5aef6b6e4c /sway | |
parent | input/seatop_default: properly notify pointer leave (diff) | |
download | sway-2913f39dcb58997ab055465154d7c7b287da10c7.tar.gz sway-2913f39dcb58997ab055465154d7c7b287da10c7.tar.zst sway-2913f39dcb58997ab055465154d7c7b287da10c7.zip |
input/cursor: release simulated tool tip button when over v2 surface
d88460f addressed sending v2 tool tip up when over a non-v2 surface.
This commit addresses the other direction.
Fixes #5230.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/input/cursor.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 0649f468..a28da999 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -618,8 +618,9 @@ static void handle_tool_tip(struct wl_listener *listener, void *data) { | |||
618 | wlr_tablet_v2_tablet_tool_notify_up(sway_tool->tablet_v2_tool); | 618 | wlr_tablet_v2_tablet_tool_notify_up(sway_tool->tablet_v2_tool); |
619 | } | 619 | } |
620 | 620 | ||
621 | cursor->simulated_tool_tip_down = event->state == WLR_TABLET_TOOL_TIP_DOWN; | ||
621 | dispatch_cursor_button(cursor, event->device, event->time_msec, | 622 | dispatch_cursor_button(cursor, event->device, event->time_msec, |
622 | BTN_LEFT, event->state == WLR_TABLET_TOOL_TIP_DOWN ? | 623 | BTN_LEFT, cursor->simulated_tool_tip_down ? |
623 | WLR_BUTTON_PRESSED : WLR_BUTTON_RELEASED); | 624 | WLR_BUTTON_PRESSED : WLR_BUTTON_RELEASED); |
624 | wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat); | 625 | wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat); |
625 | transaction_commit_dirty(); | 626 | transaction_commit_dirty(); |
@@ -630,6 +631,12 @@ static void handle_tool_tip(struct wl_listener *listener, void *data) { | |||
630 | wlr_tablet_v2_tablet_tool_notify_down(sway_tool->tablet_v2_tool); | 631 | wlr_tablet_v2_tablet_tool_notify_down(sway_tool->tablet_v2_tool); |
631 | wlr_tablet_tool_v2_start_implicit_grab(sway_tool->tablet_v2_tool); | 632 | wlr_tablet_tool_v2_start_implicit_grab(sway_tool->tablet_v2_tool); |
632 | } else { | 633 | } else { |
634 | if (cursor->simulated_tool_tip_down) { | ||
635 | dispatch_cursor_button(cursor, event->device, event->time_msec, BTN_LEFT, | ||
636 | WLR_BUTTON_RELEASED); | ||
637 | cursor->simulated_tool_tip_down = false; | ||
638 | } | ||
639 | |||
633 | wlr_tablet_v2_tablet_tool_notify_up(sway_tool->tablet_v2_tool); | 640 | wlr_tablet_v2_tablet_tool_notify_up(sway_tool->tablet_v2_tool); |
634 | } | 641 | } |
635 | } | 642 | } |