aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-02-07 18:44:25 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-02-09 16:51:05 +0000
commite1a4b5c5a80a820e3e5514ddab031eb98b14a02c (patch)
tree187024988461f570f9d442ce08702516c5bde90b
parentwayland: unify key- and mouse-binding structs (diff)
wayland: use key_bindings_destroy() to destroy the mouse bindings
-rw-r--r--wayland.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/wayland.c b/wayland.c
index 745d1b07..2bedda27 100644
--- a/wayland.c
+++ b/wayland.c
@@ -158,7 +158,12 @@ static void
key_bindings_destroy(key_binding_list_t *bindings)
{
tll_foreach(*bindings, it) {
- tll_free(it->item.k.key_codes);
+ struct key_binding *bind = &it->item;
+ switch (bind->type) {
+ case KEY_BINDING: tll_free(it->item.k.key_codes); break;
+ case MOUSE_BINDING: break;
+ }
+
tll_remove(*bindings, it);
}
}
@@ -174,8 +179,7 @@ seat_destroy(struct seat *seat)
key_bindings_destroy(&seat->kbd.bindings.key);
key_bindings_destroy(&seat->kbd.bindings.search);
key_bindings_destroy(&seat->kbd.bindings.url);
-
- tll_free(seat->mouse.bindings);
+ key_bindings_destroy(&seat->mouse.bindings);
if (seat->kbd.xkb_compose_state != NULL)
xkb_compose_state_unref(seat->kbd.xkb_compose_state);