tests/wayland-test-utils: Add helper to wait for window

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
This commit is contained in:
Jonas Ådahl 2023-01-27 20:49:40 +01:00 committed by Marge Bot
parent 9856dac593
commit 337ade622c
2 changed files with 19 additions and 0 deletions

View File

@ -135,3 +135,19 @@ meta_find_client_window (MetaContext *context,
return NULL;
}
MetaWindow *
meta_wait_for_client_window (MetaContext *context,
const char *title)
{
while (TRUE)
{
MetaWindow *window;
window = meta_find_client_window (context, title);
if (window)
return window;
g_main_context_iteration (NULL, TRUE);
}
}

View File

@ -30,4 +30,7 @@ void meta_wayland_test_client_finish (MetaWaylandTestClient *wayland_test_client
MetaWindow * meta_find_client_window (MetaContext *context,
const char *title);
MetaWindow * meta_wait_for_client_window (MetaContext *context,
const char *title);
#endif /* META_WAYLAND_TEST_UTILS_H */