summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestsystem.h
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-05-03 14:26:01 +0200
committerLiang Qi <liang.qi@qt.io>2018-05-03 14:50:22 +0200
commit60fefff22f7fa259a8bdb023d1ec9a57cfd34bfb (patch)
treeab33ab6eeb08f7a72e0196ee5025790aaa01b1dd /src/testlib/qtestsystem.h
parentb1e0a71997111fc296001bc94e0da8342cf0ac97 (diff)
parentda32360ffc3c7b677355c37ae54c89637c18047f (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts: examples/widgets/graphicsview/elasticnodes/graphwidget.cpp examples/widgets/graphicsview/elasticnodes/node.cpp examples/widgets/graphicsview/elasticnodes/node.h src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/cocoa/qnsview_drawing.mm src/widgets/kernel/qmacgesturerecognizer_p.h Change-Id: I13cf06bac75d48d779d8ee7b5c91bfc976f2a32c
Diffstat (limited to 'src/testlib/qtestsystem.h')
-rw-r--r--src/testlib/qtestsystem.h18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/testlib/qtestsystem.h b/src/testlib/qtestsystem.h
index de6bd177d3..df62b392d4 100644
--- a/src/testlib/qtestsystem.h
+++ b/src/testlib/qtestsystem.h
@@ -110,23 +110,7 @@ namespace QTest
#ifdef QT_GUI_LIB
Q_REQUIRED_RESULT inline static bool qWaitForWindowActive(QWindow *window, int timeout = 5000)
{
- bool becameActive = qWaitFor([&]() { return window->isActive(); }, timeout);
-
- // Try ensuring the platform window receives the real position.
- // (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.
- // If we just let things go, every mapTo/FromGlobal call the tests perform directly after
- // 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()) {
- if (waitNo++ > timeout / 10)
- break;
- qWait(10);
- }
- }
- return window->isActive();
+ return qWaitFor([&]() { return window->isActive(); }, timeout);
}
Q_REQUIRED_RESULT inline static bool qWaitForWindowExposed(QWindow *window, int timeout = 5000)