summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-06-04 19:34:36 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-06-04 19:34:36 +0200
commit80604a0786628a0c57eac7cc856720537956cc7f (patch)
treee31b9b56584e77d6aefd4dfd072ce4e8e3648f3d /src/plugins/platforms/ios
parent1c901913c0af79b2bbde1b9da71f5267cb4fc76a (diff)
parentc11a7d16c7056da4086a87c9e85b89f8466be032 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/corelib/global/qglobal.h src/plugins/platforms/cocoa/qnsview.mm Change-Id: I6fe345df5c417cb7a55a3f91285d9b47a22c04fa
Diffstat (limited to 'src/plugins/platforms/ios')
-rw-r--r--src/plugins/platforms/ios/qiosglobal.mm2
-rw-r--r--src/plugins/platforms/ios/qiosscreen.mm2
-rw-r--r--src/plugins/platforms/ios/qioswindow.mm11
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();