diff --git a/testsuite/gtk/test-focus-chain.c b/testsuite/gtk/test-focus-chain.c index 3846ac525d..0ab28caee9 100644 --- a/testsuite/gtk/test-focus-chain.c +++ b/testsuite/gtk/test-focus-chain.c @@ -208,14 +208,14 @@ load_ui_file (GFile *ui_file, timeout_handle_id = g_timeout_add (2000, quit_iteration_loop, &keep_running); - while (keep_running) - { - if (!g_main_context_iteration (NULL, FALSE)) - break; - } + while (keep_running && !gtk_window_is_active (GTK_WINDOW (window))) + g_main_context_iteration (NULL, TRUE); + if (keep_running) g_source_remove (timeout_handle_id); + g_assert (gtk_window_is_active (GTK_WINDOW (window))); + if (ext) { int i;