diff options
author | Leonardo Hernández Hernández <leohdz172@proton.me> | 2023-06-23 13:42:44 -0600 |
---|---|---|
committer | Leonardo Hernández Hernández <leohdz172@proton.me> | 2023-06-23 13:42:44 -0600 |
commit | fdb66ccfa3a035202369bb366a401d49bcce22a0 (patch) | |
tree | 6c870e2d632c225cb4a7ba4797bef07555b9b0a2 | |
parent | 6095ff84d2f8141f5bcedb41af75c95109e24fdf (diff) |
use detached output states to set gamma
-rw-r--r-- | dwl.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -2061,15 +2061,20 @@ void setgamma(struct wl_listener *listener, void *data) { struct wlr_gamma_control_manager_v1_set_gamma_event *event = data; - if (!wlr_gamma_control_v1_apply(event->control, &event->output->pending)) + struct wlr_output_state state; + wlr_output_state_init(&state); + if (!wlr_gamma_control_v1_apply(event->control, &state)) { + wlr_output_state_finish(&state); return; + } - if (!wlr_output_test(event->output)) { - wlr_output_rollback(event->output); + if (!wlr_output_test_state(event->output, &state)) { wlr_gamma_control_v1_send_failed_and_destroy(event->control); + wlr_output_state_finish(&state); + return; } - wlr_output_schedule_frame(event->output); + wlr_output_commit_state(event->output, &state); } void |