diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2013-11-15 19:25:54 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-18 19:26:47 +0100 |
commit | 69a8c59b3ffe81f20cb5f1425d72cca8053a0527 (patch) | |
tree | 0a99c53c234b9919f5d551090de7ac21ce54900e /tests | |
parent | 98f0b4668999d677d8bf91d57ac095d96e7a661c (diff) |
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 <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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); |