iOS: (crash fix) ensure we don't clear focus object in a text responder transition

(Backport of 5.7/8586ccc).

The original patch was implemented to handle crashes after e78ca787ae.
But the former was pushed to 5.7, and the latter to 5.6. So we need to
backport it, otherwise the same crashes will still happen in 5.6
(e.g when transferring focus from a text edit to a (picker) menu).

Change-Id: I13037735dc316bceadb571e67f38a310c8a1bfae
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
This commit is contained in:
Richard Moe Gustavsen 2016-04-21 10:14:23 +02:00 committed by Richard Moe Gustavsen
parent b19280753d
commit 3f8843f18d

View File

@ -329,7 +329,7 @@
// a regular responder transfer to another window. In the former case, iOS
// will set the new first-responder to our next-responder, and in the latter
// case we'll have an active responder candidate.
if (![UIResponder currentFirstResponder]) {
if (![UIResponder currentFirstResponder] && !FirstResponderCandidate::currentCandidate()) {
// No first responder set anymore, sync this with Qt by clearing the
// focus object.
m_inputContext->clearCurrentFocusObject();