aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/layer_shell.c2
-rw-r--r--sway/desktop/output.c8
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) {
664 664
665 struct sway_output *output = layer_surface->output->data; 665 struct sway_output *output = layer_surface->output->data;
666 sway_layer->output_destroy.notify = handle_output_destroy; 666 sway_layer->output_destroy.notify = handle_output_destroy;
667 wl_signal_add(&output->events.destroy, &sway_layer->output_destroy); 667 wl_signal_add(&output->events.disable, &sway_layer->output_destroy);
668 668
669 wl_list_insert(&output->layers[layer_surface->pending.layer], 669 wl_list_insert(&output->layers[layer_surface->pending.layer],
670 &sway_layer->link); 670 &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) {
754static void handle_destroy(struct wl_listener *listener, void *data) { 754static void handle_destroy(struct wl_listener *listener, void *data) {
755 struct sway_output *output = wl_container_of(listener, output, destroy); 755 struct sway_output *output = wl_container_of(listener, output, destroy);
756 struct sway_server *server = output->server; 756 struct sway_server *server = output->server;
757 wl_signal_emit(&output->events.destroy, output); 757 output_begin_destroy(output);
758 758
759 if (output->enabled) { 759 if (output->enabled) {
760 output_disable(output); 760 output_disable(output);
761 } 761 }
762 output_begin_destroy(output); 762
763 wl_list_remove(&output->link);
763 764
764 wl_list_remove(&output->destroy.link); 765 wl_list_remove(&output->destroy.link);
765 wl_list_remove(&output->commit.link); 766 wl_list_remove(&output->commit.link);
766 wl_list_remove(&output->mode.link); 767 wl_list_remove(&output->mode.link);
767 wl_list_remove(&output->present.link); 768 wl_list_remove(&output->present.link);
768 769
770 output->wlr_output->data = NULL;
771 output->wlr_output = NULL;
772
769 transaction_commit_dirty(); 773 transaction_commit_dirty();
770 774
771 update_output_manager_config(server); 775 update_output_manager_config(server);