summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiosviewcontroller.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/ios/qiosviewcontroller.mm')
-rw-r--r--src/plugins/platforms/ios/qiosviewcontroller.mm14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/qiosviewcontroller.mm b/src/plugins/platforms/ios/qiosviewcontroller.mm
index a7663b9e94..d7db6ba856 100644
--- a/src/plugins/platforms/ios/qiosviewcontroller.mm
+++ b/src/plugins/platforms/ios/qiosviewcontroller.mm
@@ -273,6 +273,20 @@
m_focusWindowChangeConnection = QObject::connect(qApp, &QGuiApplication::focusWindowChanged, [self]() {
[self updateProperties];
});
+
+ QIOSApplicationState *applicationState = &QIOSIntegration::instance()->applicationState;
+ QObject::connect(applicationState, &QIOSApplicationState::applicationStateDidChange,
+ [self](Qt::ApplicationState oldState, Qt::ApplicationState newState) {
+ if (oldState == Qt::ApplicationSuspended && newState != Qt::ApplicationSuspended) {
+ // We may have ignored an earlier layout because the application was suspended,
+ // and we didn't want to render anything at that moment in fear of being killed
+ // due to rendering in the background, so we trigger an explicit layout when
+ // coming out of the suspended state.
+ qCDebug(lcQpaWindow) << "triggering root VC layout when coming out of suspended state";
+ [self.view setNeedsLayout];
+ }
+ }
+ );
}
return self;