summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestsystem.h
diff options
context:
space:
mode:
authorVille Voutilainen <ville.voutilainen@qt.io>2018-02-26 15:57:55 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-02-27 08:53:09 +0000
commit2eec3272c78a3af1e362906654aa6d50b33a4c50 (patch)
treeb0ccd27f123221c157aa5241d4d1e9bf04db1317 /src/testlib/qtestsystem.h
parent1f6bd8bfb2206480ca5b5c267da38659e6cff20e (diff)
Make qWaitForWindowActive more robust
Based on the information we got from Unity developers, we need to check for window's frame geometry to be set, not just window's position to be set. On various window managers, a window is 'ready' once the frame geometry is set. This fixes autotest flakiness of tests that use qWaitForWindowActive. Task-number: QTBUG-66216 Change-Id: Icb664e7b802b474919f3b058c00681574522ccbe Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/testlib/qtestsystem.h')
-rw-r--r--src/testlib/qtestsystem.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/testlib/qtestsystem.h b/src/testlib/qtestsystem.h
index 79fe68004e..046fe1a3e7 100644
--- a/src/testlib/qtestsystem.h
+++ b/src/testlib/qtestsystem.h
@@ -114,7 +114,7 @@ namespace QTest
{
bool becameActive = qWaitFor([&]() { return window->isActive(); }, timeout);
- // Try ensuring the platform window receives the real position.
+ // Try ensuring the platform window receives the real position and geometry.
// (i.e. that window->pos() reflects reality)
// isActive() ( == FocusIn in case of X) does not guarantee this. It seems some WMs randomly
// send the final ConfigureNotify (the one with the non-bogus 0,0 position) after the FocusIn.
@@ -122,7 +122,7 @@ namespace QTest
// qWaitForWindowShown() will generate bogus results.
if (becameActive) {
int waitNo = 0; // 0, 0 might be a valid position after all, so do not wait for ever
- while (window->position().isNull()) {
+ while (window->frameGeometry().isNull()) {
if (waitNo++ > timeout / 10)
break;
qWait(10);