diff options
author | Liang Qi <liang.qi@qt.io> | 2017-11-23 12:32:56 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-11-23 12:52:18 +0100 |
commit | 7c4b0aa9706bdb79f0f79841cf6704e2f613fe69 (patch) | |
tree | 77acbaa2d335759e0a5ed04d37608dce2b12acbc /src/plugins/platforms/ios/qioswindow.mm | |
parent | 110e49c9cecca34dfacad33d19e04612cc2671b2 (diff) | |
parent | eade2255ea7cd8200569080e9b295479b1f51bed (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
src/corelib/io/qstandardpaths_win.cpp
src/plugins/platforms/ios/qioswindow.mm
src/plugins/platforms/ios/quiview.mm
tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
Change-Id: I5deb0a0176a454a9c566e924d074ba60ce04f0bc
Diffstat (limited to 'src/plugins/platforms/ios/qioswindow.mm')
-rw-r--r-- | src/plugins/platforms/ios/qioswindow.mm | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 4e6d48423d..bcec9899f7 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -239,15 +239,28 @@ void QIOSWindow::setWindowState(Qt::WindowStates state) if (window()->isTopLevel() && window()->isVisible() && window()->isActive()) [m_view.qtViewController updateProperties]; - if (state & Qt::WindowMinimized) + if (state & Qt::WindowMinimized) { applyGeometry(QRect()); - else if (state & Qt::WindowFullScreen) - applyGeometry(screen()->geometry()); - else if (state & Qt::WindowMaximized) - applyGeometry(window()->flags() & Qt::MaximizeUsingFullscreenGeometryHint ? - screen()->geometry() : screen()->availableGeometry()); - else + } else if (state & (Qt::WindowFullScreen | Qt::WindowMaximized)) { + // When an application is in split-view mode, the UIScreen still has the + // same geometry, but the UIWindow is resized to the area reserved for the + // application. We use this to constrain the geometry used when applying the + // fullscreen or maximized window states. Note that we do not do this + // in applyGeometry(), as we don't want to artificially limit window + // placement "outside" of the screen bounds if that's what the user wants. + + QRect uiWindowBounds = QRectF::fromCGRect(m_view.window.bounds).toRect(); + QRect fullscreenGeometry = screen()->geometry().intersected(uiWindowBounds); + QRect maximizedGeometry = window()->flags() & Qt::MaximizeUsingFullscreenGeometryHint ? + fullscreenGeometry : screen()->availableGeometry().intersected(uiWindowBounds); + + if (state & Qt::WindowFullScreen) + applyGeometry(fullscreenGeometry); + else + applyGeometry(maximizedGeometry); + } else { applyGeometry(m_normalGeometry); + } } void QIOSWindow::setParent(const QPlatformWindow *parentWindow) |