mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 04:45:58 +01:00
output: clear buffer created for test
When calling wlr_output_test an empty buffer might be created. This implicitly changes the pending state of the output. Ensure that such a change is only temporarily and clear such an empty buffer before returning the test result.
This commit is contained in:
parent
db6661502d
commit
cff4abc5b1
1 changed files with 10 additions and 1 deletions
|
@ -639,6 +639,9 @@ static bool output_basic_test(struct wlr_output *output) {
|
|||
}
|
||||
|
||||
bool wlr_output_test(struct wlr_output *output) {
|
||||
bool had_buffer = output->pending.committed & WLR_OUTPUT_STATE_BUFFER;
|
||||
bool success;
|
||||
|
||||
if (!output_basic_test(output)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -648,7 +651,13 @@ bool wlr_output_test(struct wlr_output *output) {
|
|||
if (!output->impl->test) {
|
||||
return true;
|
||||
}
|
||||
return output->impl->test(output);
|
||||
|
||||
success = output->impl->test(output);
|
||||
|
||||
if (!had_buffer) {
|
||||
output_clear_back_buffer(output);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
bool wlr_output_commit(struct wlr_output *output) {
|
||||
|
|
Loading…
Reference in a new issue