aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Bozhinov <ammen99@gmail.com>2020-08-03 11:48:27 +0200
committerSimon Ser <contact@emersion.fr>2020-08-03 12:05:35 +0200
commit0032954c75050276375a151389a25d4717ef1cd5 (patch)
treec31d0931e8460f96ca42f67437ec8912e705c208
parentaaf490d794bd077330c306face305f4a87de5809 (diff)
make sure to fail setting gamma on disabled outputs
-rw-r--r--types/wlr_gamma_control_v1.c1
-rw-r--r--types/wlr_output.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/types/wlr_gamma_control_v1.c b/types/wlr_gamma_control_v1.c
index 591c6aa3..48356ee1 100644
--- a/types/wlr_gamma_control_v1.c
+++ b/types/wlr_gamma_control_v1.c
@@ -108,6 +108,7 @@ static void gamma_control_handle_set_gamma(struct wl_client *client,
wlr_output_set_gamma(gamma_control->output, ramp_size, r, g, b);
if (!wlr_output_test(gamma_control->output)) {
gamma_control_send_failed(gamma_control);
+ wlr_output_rollback(gamma_control->output);
goto error_table;
}
free(table);
diff --git a/types/wlr_output.c b/types/wlr_output.c
index ce05f97b..9d02ec3c 100644
--- a/types/wlr_output.c
+++ b/types/wlr_output.c
@@ -551,6 +551,10 @@ static bool output_basic_test(struct wlr_output *output) {
wlr_log(WLR_DEBUG, "Tried to enable adaptive sync on a disabled output");
return false;
}
+ if (!enabled && output->pending.committed & WLR_OUTPUT_STATE_GAMMA_LUT) {
+ wlr_log(WLR_DEBUG, "Tried to set the gamma lut on a disabled output");
+ return false;
+ }
return true;
}