diff options
Diffstat (limited to 'tests/auto/gui/kernel/qwindow/tst_qwindow.cpp')
-rw-r--r-- | tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 36ec28de8d..0196c7d72c 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -1852,6 +1852,14 @@ void tst_QWindow::modalDialog() QGuiApplication::sync(); QGuiApplication::processEvents(); + + if (!QGuiApplication::platformName().compare(QLatin1String("offscreen"), Qt::CaseInsensitive) + || !QGuiApplication::platformName().compare(QLatin1String("minimal"), Qt::CaseInsensitive)) { + QWARN("Focus stays in normalWindow on offscreen/minimal platforms"); + QTRY_COMPARE(QGuiApplication::focusWindow(), &normalWindow); + return; + } + QTRY_COMPARE(QGuiApplication::focusWindow(), &dialog); } @@ -1890,6 +1898,14 @@ void tst_QWindow::modalDialogClosingOneOfTwoModal() QGuiApplication::sync(); QGuiApplication::processEvents(); + + if (!QGuiApplication::platformName().compare(QLatin1String("offscreen"), Qt::CaseInsensitive) + || !QGuiApplication::platformName().compare(QLatin1String("minimal"), Qt::CaseInsensitive)) { + QWARN("Focus is lost when closing modal dialog on offscreen/minimal platforms"); + QTRY_COMPARE(QGuiApplication::focusWindow(), nullptr); + return; + } + QTRY_COMPARE(QGuiApplication::focusWindow(), &first_dialog); } |