From 69a8c59b3ffe81f20cb5f1425d72cca8053a0527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 15 Nov 2013 19:25:54 +0100 Subject: tst_QWindow: Set explicit window position to please qWaitForWindowActive qWaitForWindowActive waits until the timeout for the window to receive a non-0x0 position, even when it's active, just in case the WM sets the position as a response to focus-in. Change-Id: I748cce2747f406a8cdff556465175f02675fcd13 Reviewed-by: Friedemann Kleint Reviewed-by: Gunnar Sletta --- tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index c4983f4462..bd5959786f 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -843,7 +843,10 @@ void tst_QWindow::activateAndClose() { for (int i = 0; i < 10; ++i) { QWindow window; - window.show(); + // qWaitForWindowActive will block for the duration of + // of the timeout if the window is at 0,0 + window.setGeometry(QGuiApplication::primaryScreen()->availableGeometry().adjusted(1, 1, -1, -1)); + window.showNormal(); window.requestActivate(); QVERIFY(QTest::qWaitForWindowActive(&window)); QCOMPARE(qGuiApp->focusWindow(), &window); -- cgit v1.2.3