diff options
author | Isaac Freund <mail@isaacfreund.com> | 2022-08-27 12:20:03 +0200 |
---|---|---|
committer | Isaac Freund <mail@isaacfreund.com> | 2022-08-28 16:04:22 +0200 |
commit | d94d1bf0ea9d777a03429a20c544195402965d9b (patch) | |
tree | 87a3c16b12bd9d8ef5ad8ccc61e97a19fcc708d6 | |
parent | fa7d2cb8d60ed48c44c707106c03682056ddfaca (diff) |
output: clean up after modifierless test failure
If the first test in output_ensure_buffer() fails with modifiers we
replace the swapchain with a modifierless swapchain and try again.
However if that fails as well the output is currently stuck without
modifiers until the next modeset.
To fix this, destroy the modifierless swapchain if the test using it
fails. The next output_attach_back_buffer() call will create a swapchain
that allows modifiers when needed.
-rw-r--r-- | types/output/render.c | 9 |
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; } |