iOS: fix application hangs when opening keyboard

QIOSInputContext controls QUIViews first responder status
based on whether or not the keyboard should be open.
But since QGuiApplication updates focusObject before
focusWindow (when e.g a popup closes), we sometimes ended up
activating the old window upon a call to becomeFirstResponder.
This in turn led the application to hang because of
recursive dependencies in qioscontext when the focus window
changed.

So the solution for now is to avoid activating the window
when the view becomes first responder. This should be
fine since we now activate the window from
QIOSWindow::requestActivateWindow (ref: 6272a816d1)

Task-number: QTBUG-35340
Change-Id: I3068c14fec18d84d4b0b348a043c4c054e366c75
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
bb10
Richard Moe Gustavsen 2013-12-02 22:34:26 +01:00 committed by The Qt Project
parent 9302169bd5
commit 119ea0f2db
1 changed files with 2 additions and 6 deletions

View File

@ -330,13 +330,9 @@
- (BOOL)becomeFirstResponder
{
// On iOS, a QWindow should only have input focus when the input panel is
// open. This is to stop cursors and focus rects from being drawn when the
// user cannot type. And since the keyboard will open when a view becomes
// the first responder, it's now a good time to inform QPA that the QWindow
// this view backs became active:
// Note: QIOSInputContext controls our first responder status based on
// whether or not the keyboard should be open or closed.
[self updateTextInputTraits];
QWindowSystemInterface::handleWindowActivated(m_qioswindow->window());
return [super becomeFirstResponder];
}