From 2e068dd124d82978d6e334fa2445a5fa199db2d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 2 Oct 2024 14:56:35 +0200 Subject: [PATCH] stage-view: Bump fake swap ready notify callback priority This will become important when dispatching happens from a frame clock driver, where the driver itself triggers from a GSource. If the driver source has a higher priority, we'll risk dispatching before the frame clock has returned to a state expecting to be dispatched. Part-of: --- src/backends/meta-stage-view.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backends/meta-stage-view.c b/src/backends/meta-stage-view.c index 0808680c1..7de2613fa 100644 --- a/src/backends/meta-stage-view.c +++ b/src/backends/meta-stage-view.c @@ -218,8 +218,12 @@ meta_stage_view_perform_fake_swap (MetaStageView *view, }; g_warn_if_fail (priv->notify_presented_handle_id == 0); + + /* The priority needs to be higher than the source dispatching the frame + * clock, to avoid racing with it. + */ priv->notify_presented_handle_id = - g_idle_add_full (G_PRIORITY_DEFAULT, + g_idle_add_full (G_PRIORITY_HIGH, notify_presented_idle, closure, g_free); }