summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qioscontext.mm
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2018-04-20 12:21:57 +0200
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2018-04-20 12:21:57 +0200
commitcf204590ea94bb3a191b5e783471bd6f5a04ab8e (patch)
treef96b4dc4c3995b0a3a2d1b8291144846c30baa64 /src/plugins/platforms/ios/qioscontext.mm
parentc579a77f841ed44df25553972f8807110c55808d (diff)
parent941db4e0bb3170b6bc3cf775f150a226754e6285 (diff)
Merge 5.11 into 5.11.0
Diffstat (limited to 'src/plugins/platforms/ios/qioscontext.mm')
-rw-r--r--src/plugins/platforms/ios/qioscontext.mm47
1 files changed, 26 insertions, 21 deletions
diff --git a/src/plugins/platforms/ios/qioscontext.mm b/src/plugins/platforms/ios/qioscontext.mm
index 03643c19a9..fff66049ff 100644
--- a/src/plugins/platforms/ios/qioscontext.mm
+++ b/src/plugins/platforms/ios/qioscontext.mm
@@ -301,29 +301,34 @@ bool QIOSContext::verifyGraphicsHardwareAvailability()
static dispatch_once_t onceToken = 0;
dispatch_once(&onceToken, ^{
QIOSApplicationState *applicationState = &QIOSIntegration::instance()->applicationState;
- connect(applicationState, &QIOSApplicationState::applicationStateWillChange, [](Qt::ApplicationState state) {
- if (applicationBackgrounded && state != Qt::ApplicationSuspended) {
- qCDebug(lcQpaGLContext) << "app no longer backgrounded, rendering enabled";
- applicationBackgrounded = false;
+ connect(applicationState, &QIOSApplicationState::applicationStateWillChange,
+ [](Qt::ApplicationState oldState, Qt::ApplicationState newState) {
+ Q_UNUSED(oldState);
+ if (applicationBackgrounded && newState != Qt::ApplicationSuspended) {
+ qCDebug(lcQpaGLContext) << "app no longer backgrounded, rendering enabled";
+ applicationBackgrounded = true;
+ }
}
- });
- connect(applicationState, &QIOSApplicationState::applicationStateDidChange, [](Qt::ApplicationState state) {
- if (state != Qt::ApplicationSuspended)
- return;
-
- qCDebug(lcQpaGLContext) << "app backgrounded, rendering disabled";
- applicationBackgrounded = true;
-
- // By the time we receive this signal the application has moved into
- // Qt::ApplactionStateSuspended, and all windows have been obscured,
- // which should stop all rendering. If there's still an active GL context,
- // we follow Apple's advice and call glFinish before making it inactive.
- if (QOpenGLContext *currentContext = QOpenGLContext::currentContext()) {
- qCWarning(lcQpaGLContext) << "explicitly glFinishing and deactivating" << currentContext;
- glFinish();
- currentContext->doneCurrent();
+ );
+ connect(applicationState, &QIOSApplicationState::applicationStateDidChange,
+ [](Qt::ApplicationState oldState, Qt::ApplicationState newState) {
+ Q_UNUSED(oldState);
+ if (newState != Qt::ApplicationSuspended)
+ return;
+
+ qCDebug(lcQpaGLContext) << "app backgrounded, rendering disabled";
+
+ // By the time we receive this signal the application has moved into
+ // Qt::ApplactionStateSuspended, and all windows have been obscured,
+ // which should stop all rendering. If there's still an active GL context,
+ // we follow Apple's advice and call glFinish before making it inactive.
+ if (QOpenGLContext *currentContext = QOpenGLContext::currentContext()) {
+ qCWarning(lcQpaGLContext) << "explicitly glFinishing and deactivating" << currentContext;
+ glFinish();
+ currentContext->doneCurrent();
+ }
}
- });
+ );
});
if (applicationBackgrounded) {