From e5fc8cd4c734717c471567de98a77e2482a7015f Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 14 Aug 2023 19:39:33 +0200 Subject: 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 --- backend/x11/output.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'backend/x11') 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); -- cgit v1.2.3