From d1e7e4b02c48ddc4b204046f79417b948379771d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 17 Nov 2023 13:53:57 +0100 Subject: [PATCH] Stabilize tst_ForeignWindow::embedForeignWindow() We only care about no longer being a child of the old parent window, not what the system does when we reparent to nullptr. Change-Id: Ibd670432f0fd2595195d3951014a570dfdb7a998 Reviewed-by: Oliver Wolff Reviewed-by: Friedemann Kleint (cherry picked from commit 340b9729953faa12ed889630ffb9f2eeca228649) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/gui/kernel/qwindow/tst_foreignwindow.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/auto/gui/kernel/qwindow/tst_foreignwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_foreignwindow.cpp index a43939a21b4..8abb39b2e07 100644 --- a/tests/auto/gui/kernel/qwindow/tst_foreignwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_foreignwindow.cpp @@ -81,17 +81,13 @@ void tst_ForeignWindow::embedForeignWindow() NativeWindow nativeWindow; QVERIFY(nativeWindow); - // Top level windows may not have 0 as their winId, e.g. on - // XCB the root window of the screen is used. - const auto originalParentWinId = nativeWindow.parentWinId(); - // As a prerequisite to that, we must be able to reparent the foreign window std::unique_ptr foreignWindow(QWindow::fromWinId(nativeWindow)); foreignWindow->setParent(&parentWindow); QTRY_COMPARE(nativeWindow.parentWinId(), parentWindow.winId()); foreignWindow->setParent(nullptr); - QTRY_COMPARE(nativeWindow.parentWinId(), originalParentWinId); + QTRY_VERIFY(nativeWindow.parentWinId() != parentWindow.winId()); } #include