mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-05 05:05:57 +01:00
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.
This commit is contained in:
parent
fa7d2cb8d6
commit
d94d1bf0ea
1 changed files with 8 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue