summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qioswindow.mm
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/qioswindow.mm
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/qioswindow.mm')
-rw-r--r--src/plugins/platforms/ios/qioswindow.mm11
1 files changed, 7 insertions, 4 deletions
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();