From: Matthias Clasen Date: Sun, 16 Apr 2023 07:11:24 +0000 (+0200) Subject: testsuite: Actually wait for focus X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~4^2~10^2~10 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7417d30a1fb6f737834a0d0accbbec95e32dbc03;p=gtk4.git testsuite: Actually wait for focus We were failing to properly iterate the main context here. Oops. --- 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;