From 9da772ce9e6ca28d5bb6a07a7052058aa41a91a4 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 5 Oct 2023 10:41:15 +0200 Subject: [PATCH] Apply gamma LUT when an output re-enabled References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3679 --- sway/desktop/output.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sway/desktop/output.c b/sway/desktop/output.c index aed1fdeb0..1f8724e73 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -961,6 +961,11 @@ static void handle_commit(struct wl_listener *listener, void *data) { wlr_damage_ring_set_bounds(&output->damage_ring, width, height); wlr_output_schedule_frame(output->wlr_output); } + + // Next time the output is enabled, try to re-apply the gamma LUT + if ((event->committed & WLR_OUTPUT_STATE_ENABLED) && !output->wlr_output->enabled) { + output->gamma_lut_changed = true; + } } static void handle_present(struct wl_listener *listener, void *data) {