From dc1eac0cf12593fa20122142f087bbb3bc8e7589 Mon Sep 17 00:00:00 2001 From: emersion Date: Thu, 17 Jan 2019 21:49:06 +0100 Subject: output: remove output_add_listeners Simplify the code by registering signals when outputs are created and removing signals when they are destroyed. --- sway/tree/output.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'sway/tree/output.c') diff --git a/sway/tree/output.c b/sway/tree/output.c index f24be010..3c376c6b 100644 --- a/sway/tree/output.c +++ b/sway/tree/output.c @@ -57,7 +57,6 @@ struct sway_output *output_create(struct wlr_output *wlr_output) { output->wlr_output = wlr_output; wlr_output->data = output; - wl_signal_add(&wlr_output->events.destroy, &output->destroy); wl_signal_init(&output->events.destroy); wl_list_insert(&root->all_outputs, &output->link); @@ -116,15 +115,6 @@ void output_enable(struct sway_output *output, struct output_config *oc) { input_manager_configure_xcursor(); - wl_signal_add(&wlr_output->events.mode, &output->mode); - wl_signal_add(&wlr_output->events.transform, &output->transform); - wl_signal_add(&wlr_output->events.scale, &output->scale); - wl_signal_add(&wlr_output->events.present, &output->present); - wl_signal_add(&output->damage->events.frame, &output->damage_frame); - wl_signal_add(&output->damage->events.destroy, &output->damage_destroy); - - output_add_listeners(output); - wl_signal_emit(&root->events.new_node, &output->node); arrange_layers(output); @@ -233,13 +223,6 @@ void output_disable(struct sway_output *output) { int index = list_find(root->outputs, output); list_del(root->outputs, index); - wl_list_remove(&output->mode.link); - wl_list_remove(&output->transform.link); - wl_list_remove(&output->scale.link); - wl_list_remove(&output->present.link); - wl_list_remove(&output->damage_destroy.link); - wl_list_remove(&output->damage_frame.link); - output->enabled = false; arrange_root(); @@ -255,7 +238,6 @@ void output_begin_destroy(struct sway_output *output) { node_set_dirty(&output->node); wl_list_remove(&output->link); - wl_list_remove(&output->destroy.link); output->wlr_output->data = NULL; output->wlr_output = NULL; } -- cgit v1.2.3-54-g00ecf