diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2022-02-07 18:44:25 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2022-02-09 16:51:05 +0000 |
| commit | e1a4b5c5a80a820e3e5514ddab031eb98b14a02c (patch) | |
| tree | 187024988461f570f9d442ce08702516c5bde90b | |
| parent | wayland: unify key- and mouse-binding structs (diff) | |
wayland: use key_bindings_destroy() to destroy the mouse bindings
| -rw-r--r-- | wayland.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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); |
