summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2022-09-17 14:08:40 +0200
committerMarge Bot <marge-bot@gnome.org>2022-12-01 20:10:52 +0000
commit62d91bb5fd518c452fec5ed355fb102445366601 (patch)
treeba3b2b591aeaa0a96c920a97c3ef54d68c250055
parent05efcb4b21acc98fa5636542888c0fe2da05781b (diff)
downloadmutter-62d91bb5fd518c452fec5ed355fb102445366601.tar.gz
tests: Wait for windows being mapped after show
Since having a window shown is becoming a more asynchronous process, we should wait for the window actor being mapped after requesting the window to be shown. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
-rw-r--r--src/tests/stage-view-tests.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tests/stage-view-tests.c b/src/tests/stage-view-tests.c
index 34d1575f4..080f978f8 100644
--- a/src/tests/stage-view-tests.c
+++ b/src/tests/stage-view-tests.c
@@ -117,6 +117,14 @@ wait_for_paint (ClutterActor *stage)
}
static void
+wait_for_window_map (ClutterActor *stage,
+ ClutterActor *window_actor)
+{
+ while (!clutter_actor_is_mapped (window_actor))
+ wait_for_paint (stage);
+}
+
+static void
on_stage_views_changed (ClutterActor *actor,
gboolean *stage_views_changed)
{
@@ -1158,6 +1166,7 @@ meta_test_actor_stage_views_queue_frame_drawn (void)
if (!test_window)
g_error ("Failed to find the window: %s", error->message);
window_actor = CLUTTER_ACTOR (meta_window_actor_from_window (test_window));
+ wait_for_window_map (stage, window_actor);
g_assert_nonnull (clutter_actor_peek_stage_views (window_actor));
/* Queue an X11 _NET_WM_FRAME_DRAWN event; this will find the frame clock via