input/text_input: remove event listeners on destroy

sway_input_method_relay can be destroyed from two sources, either the
seat is destroyed or the manager protocol objects are destroyed due
compositor exit.

This fixes a crash in wlroots listener checks. See #8509.
This commit is contained in:
Ferdinand Bachmann 2025-02-18 22:45:53 +01:00 committed by Simon Ser
parent 92c82e6952
commit 53126cdceb
2 changed files with 38 additions and 2 deletions

View file

@ -25,8 +25,10 @@ struct sway_input_method_relay {
struct wlr_input_method_v2 *input_method; // doesn't have to be present
struct wl_listener text_input_new;
struct wl_listener text_input_manager_destroy;
struct wl_listener input_method_new;
struct wl_listener input_method_manager_destroy;
struct wl_listener input_method_commit;
struct wl_listener input_method_new_popup_surface;
struct wl_listener input_method_grab_keyboard;