diff options
author | Simon Ser <contact@emersion.fr> | 2023-08-14 19:39:33 +0200 |
---|---|---|
committer | Alexander Orzechowski <alex@ozal.ski> | 2023-08-23 15:42:22 +0000 |
commit | e5fc8cd4c734717c471567de98a77e2482a7015f (patch) | |
tree | 6f7e10a98dac1f207066a96e75e8a7d3fb95c948 /backend/x11 | |
parent | 462f04db9e70c683a421aa015c1689fff8206781 (diff) |
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
Diffstat (limited to 'backend/x11')
-rw-r--r-- | backend/x11/output.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/backend/x11/output.c b/backend/x11/output.c index d95f0767..553f56a8 100644 --- a/backend/x11/output.c +++ b/backend/x11/output.c @@ -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); |