diff options
Diffstat (limited to 'src/plugins/platforms/ios')
-rw-r--r-- | src/plugins/platforms/ios/qiosglobal.mm | 2 | ||||
-rw-r--r-- | src/plugins/platforms/ios/qiosscreen.mm | 2 | ||||
-rw-r--r-- | src/plugins/platforms/ios/qioswindow.mm | 11 |
3 files changed, 9 insertions, 6 deletions
diff --git a/src/plugins/platforms/ios/qiosglobal.mm b/src/plugins/platforms/ios/qiosglobal.mm index 9abb4ba851..537d63ae77 100644 --- a/src/plugins/platforms/ios/qiosglobal.mm +++ b/src/plugins/platforms/ios/qiosglobal.mm @@ -142,7 +142,7 @@ QRect fromPortraitToPrimary(const QRect &rect, QPlatformScreen *screen) // aligned with UIScreen into whatever is the current orientation of QScreen. QRect geometry = screen->geometry(); return geometry.width() < geometry.height() ? rect - : QRect(rect.y(), geometry.width() - rect.width() - rect.x(), rect.height(), rect.width()); + : QRect(rect.y(), geometry.height() - rect.width() - rect.x(), rect.height(), rect.width()); } QT_END_NAMESPACE diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index c1613c1af4..106cf1a978 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -136,7 +136,7 @@ QIOSScreen::QIOSScreen(unsigned int screenIndex) int unscaledDpi = 163; // Regular iPhone DPI if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad - && deviceIdentifier != QStringLiteral("iPad2,5") /* iPad Mini */) { + && !deviceIdentifier.contains(QRegularExpression("^iPad2,[567]$")) /* excluding iPad Mini */) { unscaledDpi = 132; }; diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 02ac413b3b..0c3ae8e834 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -150,7 +150,8 @@ - (void)updateTouchList:(NSSet *)touches withState:(Qt::TouchPointState)state { - QRect applicationRect = fromCGRect(self.window.screen.applicationFrame); + QPlatformScreen *screen = QGuiApplication::primaryScreen()->handle(); + QRect applicationRect = fromPortraitToPrimary(fromCGRect(self.window.screen.applicationFrame), screen); foreach (UITouch *uiTouch, m_activeTouches.keys()) { QWindowSystemInterface::TouchPoint &touchPoint = m_activeTouches[uiTouch]; @@ -163,8 +164,10 @@ // Find the touch position relative to the window. Then calculate the screen // position by subtracting the position of the applicationRect (since UIWindow // does not take that into account when reporting its own frame): - QPoint touchPos = fromCGPoint([uiTouch locationInView:nil]); - touchPoint.area = QRectF(touchPos - applicationRect.topLeft(), QSize(0, 0)); + QRect touchInWindow = QRect(fromCGPoint([uiTouch locationInView:nil]), QSize(0, 0)); + QRect touchInScreen = fromPortraitToPrimary(touchInWindow, screen); + QPoint touchPos = touchInScreen.topLeft() - applicationRect.topLeft(); + touchPoint.area = QRectF(touchPos, QSize(0, 0)); touchPoint.normalPosition = QPointF(touchPos.x() / applicationRect.width(), touchPos.y() / applicationRect.height()); } } @@ -407,7 +410,7 @@ void QIOSWindow::requestActivateWindow() // Note that several windows can be active at the same time if they exist in the same // hierarchy (transient children). But only one window can be QGuiApplication::focusWindow(). // Dispite the name, 'requestActivateWindow' means raise and transfer focus to the window: - if (blockedByModal()) + if (!window()->isTopLevel() || blockedByModal()) return; raise(); |