diff options
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r-- | sway/input/seat.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index f2486893..0c5672bc 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -67,6 +67,12 @@ static void seat_node_destroy(struct sway_seat_node *seat_node) { | |||
67 | } | 67 | } |
68 | 68 | ||
69 | void seat_destroy(struct sway_seat *seat) { | 69 | void seat_destroy(struct sway_seat *seat) { |
70 | wlr_seat_destroy(seat->wlr_seat); | ||
71 | } | ||
72 | |||
73 | static void handle_seat_destroy(struct wl_listener *listener, void *data) { | ||
74 | struct sway_seat *seat = wl_container_of(listener, seat, destroy); | ||
75 | |||
70 | if (seat == config->handler_context.seat) { | 76 | if (seat == config->handler_context.seat) { |
71 | config->handler_context.seat = input_manager_get_default_seat(); | 77 | config->handler_context.seat = input_manager_get_default_seat(); |
72 | } | 78 | } |
@@ -87,7 +93,7 @@ void seat_destroy(struct sway_seat *seat) { | |||
87 | wl_list_remove(&seat->request_set_selection.link); | 93 | wl_list_remove(&seat->request_set_selection.link); |
88 | wl_list_remove(&seat->request_set_primary_selection.link); | 94 | wl_list_remove(&seat->request_set_primary_selection.link); |
89 | wl_list_remove(&seat->link); | 95 | wl_list_remove(&seat->link); |
90 | wlr_seat_destroy(seat->wlr_seat); | 96 | wl_list_remove(&seat->destroy.link); |
91 | for (int i = 0; i < seat->deferred_bindings->length; i++) { | 97 | for (int i = 0; i < seat->deferred_bindings->length; i++) { |
92 | free_sway_binding(seat->deferred_bindings->items[i]); | 98 | free_sway_binding(seat->deferred_bindings->items[i]); |
93 | } | 99 | } |
@@ -534,6 +540,9 @@ struct sway_seat *seat_create(const char *seat_name) { | |||
534 | return NULL; | 540 | return NULL; |
535 | } | 541 | } |
536 | 542 | ||
543 | seat->destroy.notify = handle_seat_destroy; | ||
544 | wl_signal_add(&seat->wlr_seat->events.destroy, &seat->destroy); | ||
545 | |||
537 | seat->idle_inhibit_sources = seat->idle_wake_sources = | 546 | seat->idle_inhibit_sources = seat->idle_wake_sources = |
538 | IDLE_SOURCE_KEYBOARD | | 547 | IDLE_SOURCE_KEYBOARD | |
539 | IDLE_SOURCE_POINTER | | 548 | IDLE_SOURCE_POINTER | |