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 <oliver.wolff@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 340b9729953faa12ed889630ffb9f2eeca228649) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
9ceb7cb555
commit
d1e7e4b02c
@ -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<QWindow> 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 <tst_foreignwindow.moc>
|
||||
|
Loading…
x
Reference in New Issue
Block a user