mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
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:
parent
462f04db9e
commit
e5fc8cd4c7
7 changed files with 24 additions and 9 deletions
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "backend/x11.h"
|
||||
#include "util/time.h"
|
||||
#include "types/wlr_output.h"
|
||||
|
||||
static const uint32_t SUPPORTED_OUTPUT_STATE =
|
||||
WLR_OUTPUT_STATE_BACKEND_OPTIONAL |
|
||||
|
|
@ -375,6 +376,10 @@ static bool output_commit(struct wlr_output *wlr_output,
|
|||
if (!output_commit_buffer(output, state)) {
|
||||
return false;
|
||||
}
|
||||
} else if (output_pending_enabled(wlr_output, state)) {
|
||||
uint32_t serial = output->wlr_output.commit_seq;
|
||||
uint64_t target_msc = output->last_msc ? output->last_msc + 1 : 0;
|
||||
xcb_present_notify_msc(x11->xcb, output->win, serial, target_msc, 0, 0);
|
||||
}
|
||||
|
||||
xcb_flush(x11->xcb);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue