aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorLibravatar Ronan Pigott <rpigott@berkeley.edu>2021-10-24 18:49:39 -0700
committerLibravatar Simon Ser <contact@emersion.fr>2021-12-17 14:39:48 +0100
commitebfe432ec3064094faebe0913b2d98932d590bfd (patch)
tree8a512564f0948e673c27e3bff0e8b5aa41bb7304 /sway/desktop/output.c
parentHandle border width and height on minimum floating sizes (diff)
downloadsway-ebfe432ec3064094faebe0913b2d98932d590bfd.tar.gz
sway-ebfe432ec3064094faebe0913b2d98932d590bfd.tar.zst
sway-ebfe432ec3064094faebe0913b2d98932d590bfd.zip
output: change output::destroy to output::disable
This changes output::destroy to output::disable and emits it only once when an output is disabled, instead of twice in succession.
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r--sway/desktop/output.c8
1 files changed, 6 insertions, 2 deletions
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);