mirror of
https://github.com/swaywm/sway.git
synced 2025-03-04 06:34:44 +01:00
input/input-manager: remove event listeners on fini
This fixes a crash in wlroots listener checks. See #8509.
This commit is contained in:
parent
a815274280
commit
eb043295bc
3 changed files with 11 additions and 0 deletions
|
@ -39,6 +39,8 @@ struct sway_input_manager {
|
|||
|
||||
struct sway_input_manager *input_manager_create(struct sway_server *server);
|
||||
|
||||
void input_manager_finish(struct sway_server *server);
|
||||
|
||||
bool input_manager_has_focus(struct sway_node *node);
|
||||
|
||||
void input_manager_set_focus(struct sway_node *node);
|
||||
|
|
|
@ -493,6 +493,14 @@ struct sway_input_manager *input_manager_create(struct sway_server *server) {
|
|||
return input;
|
||||
}
|
||||
|
||||
void input_manager_finish(struct sway_server *server) {
|
||||
wl_list_remove(&server->input->new_input.link);
|
||||
wl_list_remove(&server->input->virtual_keyboard_new.link);
|
||||
wl_list_remove(&server->input->virtual_pointer_new.link);
|
||||
wl_list_remove(&server->input->keyboard_shortcuts_inhibit_new_inhibitor.link);
|
||||
wl_list_remove(&server->input->transient_seat_create.link);
|
||||
}
|
||||
|
||||
bool input_manager_has_focus(struct sway_node *node) {
|
||||
struct sway_seat *seat = NULL;
|
||||
wl_list_for_each(seat, &server.input->seats, link) {
|
||||
|
|
|
@ -475,6 +475,7 @@ void server_fini(struct sway_server *server) {
|
|||
wl_list_remove(&server->xdg_activation_v1_request_activate.link);
|
||||
wl_list_remove(&server->xdg_activation_v1_new_token.link);
|
||||
wl_list_remove(&server->request_set_cursor_shape.link);
|
||||
input_manager_finish(server);
|
||||
|
||||
// TODO: free sway-specific resources
|
||||
#if WLR_HAS_XWAYLAND
|
||||
|
|
Loading…
Add table
Reference in a new issue