From 2913f39dcb58997ab055465154d7c7b287da10c7 Mon Sep 17 00:00:00 2001 From: Tudor Brindus Date: Sat, 25 Apr 2020 22:12:59 -0400 Subject: 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. --- sway/input/cursor.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sway/input/cursor.c') 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) { wlr_tablet_v2_tablet_tool_notify_up(sway_tool->tablet_v2_tool); } + cursor->simulated_tool_tip_down = event->state == WLR_TABLET_TOOL_TIP_DOWN; dispatch_cursor_button(cursor, event->device, event->time_msec, - BTN_LEFT, event->state == WLR_TABLET_TOOL_TIP_DOWN ? + BTN_LEFT, cursor->simulated_tool_tip_down ? WLR_BUTTON_PRESSED : WLR_BUTTON_RELEASED); wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat); transaction_commit_dirty(); @@ -630,6 +631,12 @@ static void handle_tool_tip(struct wl_listener *listener, void *data) { wlr_tablet_v2_tablet_tool_notify_down(sway_tool->tablet_v2_tool); wlr_tablet_tool_v2_start_implicit_grab(sway_tool->tablet_v2_tool); } else { + if (cursor->simulated_tool_tip_down) { + dispatch_cursor_button(cursor, event->device, event->time_msec, BTN_LEFT, + WLR_BUTTON_RELEASED); + cursor->simulated_tool_tip_down = false; + } + wlr_tablet_v2_tablet_tool_notify_up(sway_tool->tablet_v2_tool); } } -- cgit v1.2.3-54-g00ecf