aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--types/output/render.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/types/output/render.c b/types/output/render.c
index 2e38919a..eaacf8a0 100644
--- a/types/output/render.c
+++ b/types/output/render.c
@@ -240,7 +240,7 @@ bool output_ensure_buffer(struct wlr_output *output,
}
if (!output_attach_empty_back_buffer(output, state)) {
- return false;
+ goto error_destroy_swapchain;
}
if (output_test_with_back_buffer(output, state)) {
@@ -250,6 +250,13 @@ bool output_ensure_buffer(struct wlr_output *output,
output_clear_back_buffer(output);
+error_destroy_swapchain:
+ // Destroy the modifierless swapchain so that the output does not get stuck
+ // without modifiers. A new swapchain with modifiers will be created when
+ // needed by output_attach_back_buffer().
+ wlr_swapchain_destroy(output->swapchain);
+ output->swapchain = NULL;
+
return false;
}