diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-04-16 15:32:30 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-04-18 11:32:11 +0000 |
commit | e0e1c7ec2da121fa2b3acc8e76eb96e959954608 (patch) | |
tree | 83af971e85a1ecbc7b0ea60b2ce8bba60218d585 /src/plugins/platforms/ios/qiosapplicationstate.mm | |
parent | a75f25a43fd4bc5dab659dfc8d79a120258cec5f (diff) |
iOS: Trigger manual layout of root view controller when coming out of background
When rotating the device when the application is in the background iOS will
ask the root view controller to layout its views when then foregrounding the
application, but at that point the application state is still in the suspended
state, meaning we block any view resizing or rendering.
To ensure the views are resized correctly, we trigger a manual layout after
the application comes out of the suspended state.
Task-number: QTBUG-67719
Change-Id: I1ef0a4133d4b94edaac7b0f3cb4e49e367eb76d4
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/plugins/platforms/ios/qiosapplicationstate.mm')
-rw-r--r-- | src/plugins/platforms/ios/qiosapplicationstate.mm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/platforms/ios/qiosapplicationstate.mm b/src/plugins/platforms/ios/qiosapplicationstate.mm index 3407aebf8f..6d9bcdacbf 100644 --- a/src/plugins/platforms/ios/qiosapplicationstate.mm +++ b/src/plugins/platforms/ios/qiosapplicationstate.mm @@ -87,18 +87,18 @@ QIOSApplicationState::QIOSApplicationState() void QIOSApplicationState::handleApplicationStateChanged(UIApplicationState uiState, const QString &reason) { - Qt::ApplicationState state = toQtApplicationState(uiState); - qCDebug(lcQpaApplication) << qPrintable(reason) - << "- moving from" << QGuiApplication::applicationState() << "to" << state; + Qt::ApplicationState oldState = QGuiApplication::applicationState(); + Qt::ApplicationState newState = toQtApplicationState(uiState); + qCDebug(lcQpaApplication) << qPrintable(reason) << "- moving from" << oldState << "to" << newState; if (QIOSIntegration *integration = QIOSIntegration::instance()) { - emit integration->applicationState.applicationStateWillChange(state); - QWindowSystemInterface::handleApplicationStateChanged(state); - emit integration->applicationState.applicationStateDidChange(state); - qCDebug(lcQpaApplication) << "done moving to" << state; + emit integration->applicationState.applicationStateWillChange(oldState, newState); + QWindowSystemInterface::handleApplicationStateChanged(newState); + emit integration->applicationState.applicationStateDidChange(oldState, newState); + qCDebug(lcQpaApplication) << "done moving to" << newState; } else { qCDebug(lcQpaApplication) << "no platform integration yet, setting state directly"; - QGuiApplicationPrivate::applicationState = state; + QGuiApplicationPrivate::applicationState = newState; } } |