aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-07-22 17:06:30 +0100
committeremersion <contact@emersion.fr>2018-08-02 23:33:59 +0100
commit6e8892d4d71c231120ddcfb15e1a86c30cf9e497 (patch)
treed3aac7e6a08bfcc4a71f350494e56738736b87cf
parenta5cab82a0f1a766e25a017036a8f7f39db0c889a (diff)
gamma-control-v1: don't insert control in the list before checking unicity
-rw-r--r--types/wlr_gamma_control_v1.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/types/wlr_gamma_control_v1.c b/types/wlr_gamma_control_v1.c
index 36d9296b..063837fc 100644
--- a/types/wlr_gamma_control_v1.c
+++ b/types/wlr_gamma_control_v1.c
@@ -148,7 +148,7 @@ static void gamma_control_manager_get_gamma_control(struct wl_client *client,
gamma_control->output_destroy_listener.notify =
gamma_control_handle_output_destroy;
- wl_list_insert(&manager->controls, &gamma_control->link);
+ wl_list_init(&gamma_control->link);
if (!output->impl->set_gamma) {
zwlr_gamma_control_v1_send_failed(gamma_control->resource);
@@ -165,6 +165,8 @@ static void gamma_control_manager_get_gamma_control(struct wl_client *client,
}
}
+ wl_list_remove(&gamma_control->link);
+ wl_list_insert(&manager->controls, &gamma_control->link);
zwlr_gamma_control_v1_send_gamma_size(gamma_control->resource,
wlr_output_get_gamma_size(output));
}