From a15db3a81aa6053d1b3ce346b4cb160c064a2c43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 7 May 2018 16:17:21 +0200 Subject: iOS: Guard all uses of APIs not available in application extensions Change-Id: Ic058a0c07f6cdd0a015f46db96fce1536a712711 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiosinputcontext.mm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/ios/qiosinputcontext.mm') diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm index 050c592aca..493c283ec1 100644 --- a/src/plugins/platforms/ios/qiosinputcontext.mm +++ b/src/plugins/platforms/ios/qiosinputcontext.mm @@ -49,6 +49,8 @@ #include "qioswindow.h" #include "quiview.h" +#include + #include #include @@ -536,6 +538,11 @@ void QIOSInputContext::scroll(int y) if (!rootView) return; + if (qt_apple_isApplicationExtension()) { + qWarning() << "can't scroll root view in application extension"; + return; + } + CATransform3D translationTransform = CATransform3DMakeTranslation(0.0, -y, 0.0); if (CATransform3DEqualToTransform(translationTransform, rootView.layer.sublayerTransform)) return; @@ -574,7 +581,7 @@ void QIOSInputContext::scroll(int y) // Raise all known windows to above the status-bar if we're scrolling the screen, // while keeping the relative window level between the windows the same. - NSArray *applicationWindows = [[UIApplication sharedApplication] windows]; + NSArray *applicationWindows = [qt_apple_sharedApplication() windows]; static QHash originalWindowLevels; for (UIWindow *window in applicationWindows) { if (keyboardScrollIsActive && !originalWindowLevels.contains(window)) -- cgit v1.2.3