From f81539eba86e0f0cd0cf3e2e8f12e141c8613ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Wed, 14 Aug 2024 12:47:28 -0600 Subject: [PATCH] use a swapchain buffer when enabling an output via wlr_output_management_v1 --- dwl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dwl.c b/dwl.c index 7c176f0..6dc91b9 100644 --- a/dwl.c +++ b/dwl.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -1959,8 +1960,10 @@ outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test) goto out; for (i = 0; i < states_len; i++) { - Monitor *m = states[i].output->data; - wlr_scene_output_build_state(m->scene_output, &states[i].base, NULL); + struct wlr_swapchain *swapchain = wlr_output_swapchain_manager_get_swapchain( + &swapchain_manager, states[i].output); + if (swapchain && !states[i].output->enabled) + wlr_output_state_set_buffer(&states[i].base, wlr_swapchain_acquire(swapchain)); } if (!(ok = wlr_backend_commit(backend, states, states_len)))