diff options
Diffstat (limited to 'wayland.c')
| -rw-r--r-- | wayland.c | 24 |
1 files changed, 17 insertions, 7 deletions
@@ -158,11 +158,26 @@ static void key_bindings_destroy(key_binding_list_t *bindings) { tll_foreach(*bindings, it) { - tll_free(it->item.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); } } +void +wayl_bindings_reset(struct seat *seat) +{ + + key_bindings_destroy(&seat->kbd.bindings.key); + key_bindings_destroy(&seat->kbd.bindings.search); + key_bindings_destroy(&seat->kbd.bindings.url); + key_bindings_destroy(&seat->mouse.bindings); +} + static void seat_destroy(struct seat *seat) { @@ -170,12 +185,7 @@ seat_destroy(struct seat *seat) return; tll_free(seat->mouse.buttons); - - 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); + wayl_bindings_reset(seat); if (seat->kbd.xkb_compose_state != NULL) xkb_compose_state_unref(seat->kbd.xkb_compose_state); |
