summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qioswindow.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/ios/qioswindow.mm')
-rw-r--r--src/plugins/platforms/ios/qioswindow.mm11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm
index 41a253e605..f0f436f405 100644
--- a/src/plugins/platforms/ios/qioswindow.mm
+++ b/src/plugins/platforms/ios/qioswindow.mm
@@ -247,6 +247,9 @@
m_activeTouches[touch].id = m_nextTouchId++;
}
+ if (m_activeTouches.size() == 1 && m_qioswindow->window() != QGuiApplication::focusWindow())
+ m_qioswindow->requestActivateWindow();
+
[self updateTouchList:touches withState:Qt::TouchPointPressed];
[self sendTouchEventWithTimestamp:ulong(event.timestamp * 1000)];
}
@@ -259,14 +262,6 @@
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
- QWindow *window = m_qioswindow->window();
- if (window != QGuiApplication::focusWindow() && m_activeTouches.size() == 1) {
- // Activate the touched window if the last touch was released inside it:
- UITouch *touch = static_cast<UITouch *>([[touches allObjects] lastObject]);
- if (CGRectContainsPoint([self bounds], [touch locationInView:self]))
- m_qioswindow->requestActivateWindow();
- }
-
[self updateTouchList:touches withState:Qt::TouchPointReleased];
[self sendTouchEventWithTimestamp:ulong(event.timestamp * 1000)];