cursor: prevent Drag mousebinds from running without button press

For `Drag` mousebinds, `pressed_in_context` is set by
`cursor_process_button_press()` and cleared by `cursor_process_motion()`
which runs actions bound to them. However, when `cursor_process_motion()`
is called while interactive move/resize, it doesn't clear
`pressed_in_context` due to the early-return and the `Drag` mousebinds are
unexpectedly executed on another call to `cursor_process_motion()` after
the interactive move/resize is finished by button release, even when the
button is not pressed.

So this commit fixes it by always clearing `pressed_in_context` on button
releases.
This commit is contained in:
tokyo4j 2024-09-24 04:49:08 +09:00 committed by Johan Malm
parent 452f45cd3d
commit 1557cb774f
3 changed files with 14 additions and 14 deletions

View file

@ -516,7 +516,7 @@ handle_tablet_tool_tip(struct wl_listener *listener, void *data)
wlr_tablet_v2_tablet_tool_notify_up(tool->tool_v2);
}
bool exit_interactive = cursor_finish_button_release(tool->seat);
bool exit_interactive = cursor_finish_button_release(tool->seat, BTN_LEFT);
if (exit_interactive && surface && tool->tool_v2->focused_surface) {
/*
* Re-enter the surface after a resize/move to ensure