aboutsummaryrefslogtreecommitdiff
path: root/wayland.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-12-12 18:05:24 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-12-12 18:05:24 +0000
commitff96ce1e91e5a8de451541cc7584fb6f64a6564b (patch)
treed94f21a60bcdd95ee39ae8918dba707d42940634 /wayland.c
parentinput: report mouse drag events also when the pointer is outside the grid (diff)
input: rework mouse button/motion handling
Store a list of currently pressed buttons, and which surface they belong to (i.e. which surface that received the press). Then, in motion events (with a button pressed, aka drag operations), send the event to the “original” surface (that received the press). Also send release events to the originating surface. This means a surface receiving a press will always receive a corresponding release. And no one will receive a release event without a corresponding press event. Motion events with a button pressed will *always* use the *first* button that was pressed. I.e. if you press a button, start dragging, and then press another button, we keep generating motion events for the *first* button.
Diffstat (limited to 'wayland.c')
-rw-r--r--wayland.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/wayland.c b/wayland.c
index c8cb2c9c..f156533e 100644
--- a/wayland.c
+++ b/wayland.c
@@ -138,6 +138,8 @@ seat_destroy(struct seat *seat)
if (seat == NULL)
return;
+ tll_free(seat->mouse.buttons);
+
tll_foreach(seat->kbd.bindings.key, it)
tll_free(it->item.bind.key_codes);
tll_free(seat->kbd.bindings.key);