output: trigger frame/present events on all commits on enabled output

Up until now, frame/present events were only triggered when the
user submitted a buffer. Change the wlr_output API so that these
events are triggered when any commit is applied on an enabled
output.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3708
This commit is contained in:
Simon Ser 2023-08-14 19:39:33 +02:00 committed by Alexander Orzechowski
parent 462f04db9e
commit e5fc8cd4c7
7 changed files with 24 additions and 9 deletions

View file

@ -5,6 +5,7 @@
#include <wlr/types/wlr_output_layer.h>
#include <wlr/util/log.h>
#include "backend/headless.h"
#include "types/wlr_output.h"
static const uint32_t SUPPORTED_OUTPUT_STATE =
WLR_OUTPUT_STATE_BACKEND_OPTIONAL |
@ -65,7 +66,7 @@ static bool output_commit(struct wlr_output *wlr_output,
output_update_refresh(output, state->custom_mode.refresh);
}
if (state->committed & WLR_OUTPUT_STATE_BUFFER) {
if (output_pending_enabled(wlr_output, state)) {
struct wlr_output_event_present present_event = {
.commit_seq = wlr_output->commit_seq + 1,
.presented = true,