Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Commit

Permalink
use detached output states to set gamma
Browse files Browse the repository at this point in the history
  • Loading branch information
sevz17 committed Jun 23, 2023
1 parent 6095ff8 commit fdb66cc
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions dwl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fdb66cc

Please sign in to comment.