diff options
Diffstat (limited to 'src/plugins/platforms/ios/qiosviewcontroller.mm')
-rw-r--r-- | src/plugins/platforms/ios/qiosviewcontroller.mm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/qiosviewcontroller.mm b/src/plugins/platforms/ios/qiosviewcontroller.mm index 787c6b8409..f254a8692d 100644 --- a/src/plugins/platforms/ios/qiosviewcontroller.mm +++ b/src/plugins/platforms/ios/qiosviewcontroller.mm @@ -271,6 +271,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; |