From aa52e34173409e8bb23d7968a4ae0f2a9e166e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Lefebvre?= Date: Mon, 30 Jun 2025 16:22:49 +0200 Subject: [PATCH] Fix flaky tst_QWindow::windowExposedAfterReparent on Ubuntu 24.04 tst_QWindow::windowExposedAfterReparent is flaky on Ubuntu 24.04. The child qwindow being reparented is not correctly converted to a toplevel window by the window manager. Close the child qwindow before reparenting it. Fixes: QTBUG-129023 Change-Id: I9152e4cc3acd3ac757cb5e3b18669a07acd82e33 Reviewed-by: Axel Spoerl --- tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 6 ++++-- .../widgets/graphicsview/qgraphicsanchorlayout/BLACKLIST | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 39051276371..1c8dd14eba4 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -3264,12 +3264,14 @@ void tst_QWindow::windowExposedAfterReparent() QVERIFY(QTest::qWaitForWindowExposed(&parent)); QVERIFY(QTest::qWaitForWindowExposed(&child)); + // Close the child before reparenting it to ensure it is correctly converted + // to a toplevel window by the window manager. + child.close(); child.setParent(nullptr); - QCoreApplication::processEvents(); + child.show(); QVERIFY(QTest::qWaitForWindowExposed(&child)); child.setParent(&parent); - QCoreApplication::processEvents(); QVERIFY(QTest::qWaitForWindowExposed(&child)); } diff --git a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/BLACKLIST b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/BLACKLIST index aca3147b2d6..fde971443d4 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/BLACKLIST +++ b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/BLACKLIST @@ -1,3 +1,2 @@ [layoutDirection] ubuntu-22.04 -ubuntu-24.04