aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorRonan Pigott <rpigott@berkeley.edu>2021-10-24 18:49:39 -0700
committerSimon Ser <contact@emersion.fr>2021-12-17 14:39:48 +0100
commitebfe432ec3064094faebe0913b2d98932d590bfd (patch)
tree8a512564f0948e673c27e3bff0e8b5aa41bb7304 /sway/desktop/output.c
parentf2b6d1ec290014674bf2755a3488aef8ab51a182 (diff)
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) {
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);