aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wayland.c16
-rw-r--r--wayland.h2
2 files changed, 13 insertions, 5 deletions
diff --git a/wayland.c b/wayland.c
index 2bedda27..7206d982 100644
--- a/wayland.c
+++ b/wayland.c
@@ -168,6 +168,16 @@ key_bindings_destroy(key_binding_list_t *bindings)
}
}
+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)
{
@@ -175,11 +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);
- key_bindings_destroy(&seat->mouse.bindings);
+ wayl_bindings_reset(seat);
if (seat->kbd.xkb_compose_state != NULL)
xkb_compose_state_unref(seat->kbd.xkb_compose_state);
diff --git a/wayland.h b/wayland.h
index d69ec9e0..78788278 100644
--- a/wayland.h
+++ b/wayland.h
@@ -515,3 +515,5 @@ bool wayl_win_subsurface_new_with_custom_parent(
struct wl_window *win, struct wl_surface *parent,
struct wl_surf_subsurf *surf);
void wayl_win_subsurface_destroy(struct wl_surf_subsurf *surf);
+
+void wayl_bindings_reset(struct seat *seat);