diff options
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/layer_shell.c | 2 | ||||
-rw-r--r-- | sway/desktop/output.c | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index db78b59f..da59016d 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c @@ -664,7 +664,7 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) { struct sway_output *output = layer_surface->output->data; sway_layer->output_destroy.notify = handle_output_destroy; - wl_signal_add(&output->events.destroy, &sway_layer->output_destroy); + wl_signal_add(&output->events.disable, &sway_layer->output_destroy); wl_list_insert(&output->layers[layer_surface->pending.layer], &sway_layer->link); diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 3ae97e66..68f095c0 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -754,18 +754,22 @@ static void update_output_manager_config(struct sway_server *server) { static void handle_destroy(struct wl_listener *listener, void *data) { struct sway_output *output = wl_container_of(listener, output, destroy); struct sway_server *server = output->server; - wl_signal_emit(&output->events.destroy, output); + output_begin_destroy(output); if (output->enabled) { output_disable(output); } - output_begin_destroy(output); + + wl_list_remove(&output->link); wl_list_remove(&output->destroy.link); wl_list_remove(&output->commit.link); wl_list_remove(&output->mode.link); wl_list_remove(&output->present.link); + output->wlr_output->data = NULL; + output->wlr_output = NULL; + transaction_commit_dirty(); update_output_manager_config(server); |