From 16e8eca3621b89730f13e07c258fb8a4ae68a1ce Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 2 Jan 2013 11:03:59 +0100 Subject: iOS: transfer focus to the window touched MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since our QWindows are UIViews rather than UIWindows, we need to implement window activation manually. This patch will ensure that the window touched by the user also gets keyboard focus. Change-Id: I9390c5c8e50a4b066cd1320a2a044e02f2a9f75d Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qioswindow.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 88debb7c33..c7c27c08ce 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -151,6 +151,11 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { + // Transfer focus to the touched window: + QWindow *window = m_qioswindow->window(); + if (window != QGuiApplication::focusWindow()) + QWindowSystemInterface::handleWindowActivated(window); + [self sendMouseEventForTouches:touches withEvent:event fakeButtons:Qt::LeftButton]; } -- cgit v1.2.3