diff options
author | Tor Arne Vestbø <[email protected]> | 2022-12-15 16:40:34 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <[email protected]> | 2022-12-16 18:29:21 +0000 |
commit | 11ed1f643fbb14d7d7dd7d2949e720ff1ed1a0ac (patch) | |
tree | 6808887bbb50032b7d331017aa9fc092ecc34ea0 | |
parent | 0ef6a30790445f8b18913cfbb401a4123c16df9b (diff) |
iOS: Don't assume screens will not be connected before QIOSIntegration
When an external screen is connected to an iPad, and the application is
starting up on that screen, we will get a connection notification about
that screen as part of the initial bootstrap of UIApplicationMain,
before we call the user's main().
Since we initialize and add all available screen on QIOSIntegration
creation, we can just ignore the early connection notification.
This avoids a crash, but the window will not show anything on the
external screen, which is a separate issue.
Fixes: QTBUG-106701
Change-Id: I9e0a9736bf602277316bd004e0d01c640feaf319
Reviewed-by: Volker Hilsheimer <[email protected]>
(cherry picked from commit dd49793bc3b4dd3808f0f24b717c442a5095db14)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
-rw-r--r-- | src/plugins/platforms/ios/qiosscreen.mm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index d1ec359f9f5..be17972d367 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -73,8 +73,8 @@ static QIOSScreen* qtPlatformScreenFor(UIScreen *uiScreen) + (void)screenConnected:(NSNotification*)notification { - Q_ASSERT_X(QIOSIntegration::instance(), Q_FUNC_INFO, - "Screen connected before QIOSIntegration creation"); + if (!QIOSIntegration::instance()) + return; // Will be added when QIOSIntegration is created QWindowSystemInterface::handleScreenAdded(new QIOSScreen([notification object])); } |