]> git.mdlowis.com Git - proto/labwc.git/commit
cursor: prevent Drag mousebinds from running without button press
authortokyo4j <hrak1529@gmail.com>
Mon, 23 Sep 2024 19:49:08 +0000 (04:49 +0900)
committerJohan Malm <johanmalm@users.noreply.github.com>
Tue, 1 Oct 2024 20:26:19 +0000 (21:26 +0100)
commit1557cb774f6d74d5b9c2c7b476d1c35925609dd8
treefa593340c4d80a4852bf11e53cfeed4f176dff12
parent452f45cd3d6695299d8014c271db094da11fad05
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.
include/input/cursor.h
src/input/cursor.c
src/input/tablet.c