diff options
Diffstat (limited to 'tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp')
-rw-r--r-- | tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp index ccd8d0ec05..099a099c13 100644 --- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp +++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp @@ -364,6 +364,16 @@ void tst_QOpenGLWidget::asViewport() widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); + if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) { + // On some platforms (macOS), the palette will be different depending on if a + // window is active or not. And because of that, the whole window will be + // repainted when going from Inactive to Active. So wait for the window to be + // active before we continue, so the activation doesn't happen at a random + // time below. And call processEvents to have the paint events delivered right away. + QVERIFY(QTest::qWaitForWindowActive(&widget)); + qApp->processEvents(); + } + QVERIFY(view->paintCount() > 0); view->resetPaintCount(); |