Verified Commit d85ce480 authored by Sebastian Krzyszkowiak's avatar Sebastian Krzyszkowiak
Browse files

text-input: Remove relay's signal listeners when seat is destroyed

parent cfd9c165
......@@ -763,6 +763,8 @@ static void roots_seat_handle_destroy(struct wl_listener *listener,
// TODO: probably more to be freed here
wl_list_remove(&seat->destroy.link);
roots_input_method_relay_destroy(&seat->im_relay);
struct roots_seat_view *view, *nview;
wl_list_for_each_safe(view, nview, &seat->views, link) {
seat_view_destroy(view);
......
......@@ -304,6 +304,11 @@ void roots_input_method_relay_init(struct roots_seat *seat,
&relay->input_method_new);
}
void roots_input_method_relay_destroy(struct roots_input_method_relay *relay) {
wl_list_remove(&relay->text_input_new.link);
wl_list_remove(&relay->input_method_new.link);
}
void roots_input_method_relay_set_focus(struct roots_input_method_relay *relay,
struct wlr_surface *surface) {
struct roots_text_input *text_input;
......
......@@ -52,6 +52,8 @@ struct roots_text_input {
void roots_input_method_relay_init(struct roots_seat *seat,
struct roots_input_method_relay *relay);
void roots_input_method_relay_destroy(struct roots_input_method_relay *relay);
// Updates currently focused surface. Surface must belong to the same seat.
void roots_input_method_relay_set_focus(struct roots_input_method_relay *relay,
struct wlr_surface *surface);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment