From 765f55dfbeab5cf50b21e47d844976f967f3d484 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 16 Apr 2023 20:58:26 +0200 Subject: [PATCH] testsuite: Skip focus tests when necessary If our window does not get focus, we can't reliably test things that depend on widgets being focused. --- testsuite/gtk/test-focus-chain.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/testsuite/gtk/test-focus-chain.c b/testsuite/gtk/test-focus-chain.c index 0ab28caee9..63484ee1a5 100644 --- a/testsuite/gtk/test-focus-chain.c +++ b/testsuite/gtk/test-focus-chain.c @@ -214,7 +214,11 @@ load_ui_file (GFile *ui_file, if (keep_running) g_source_remove (timeout_handle_id); - g_assert (gtk_window_is_active (GTK_WINDOW (window))); + if (!gtk_window_is_active (GTK_WINDOW (window))) + { + g_print ("Skipping focus tests because window did not get focus. Headless display?"); + exit (77); + } if (ext) {