aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-01-13 10:22:50 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-01-13 10:22:50 +0000
commit7bb8d48b75657f246e8ff87becdf64e681527ebc (patch)
tree73534eb2f740a45bd80108c35a51d03201fb0470 /input.c
parentinput: reset view when pasting from primary (diff)
parentinput: reset mouse button click counter when mouse moves (diff)
Merge branch 'improve-mouse-button-multi-click'
Closes #883
Diffstat (limited to 'input.c')
-rw-r--r--input.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/input.c b/input.c
index 6013634e..885ae02e 100644
--- a/input.c
+++ b/input.c
@@ -2046,6 +2046,13 @@ wl_pointer_motion(void *data, struct wl_pointer *wl_pointer,
bool cursor_is_on_new_cell
= old_col != seat->mouse.col || old_row != seat->mouse.row;
+ if (cursor_is_on_new_cell) {
+ /* Prevent multiple/different mouse bindings from
+ * triggering if the mouse has moved “too much” (to
+ * another cell) */
+ seat->mouse.count = 0;
+ }
+
/* Cursor is inside the grid, i.e. *not* in the margins */
const bool cursor_is_on_grid = seat->mouse.col >= 0 && seat->mouse.row >= 0;