diff options
authorRichard Moe Gustavsen <>2016-04-21 10:14:23 +0200
committerRichard Moe Gustavsen <>2016-04-22 06:36:59 +0000
commit8586cccc071240a8eff6c5aa53a90010dae55193 (patch)
parent276adc5a09914fd89d976bb90cc0cd67de9d3d6e (diff)
iOS: (crash fix) ensure we don't clear focus object in a text responder transition
When IM hints changes (e.g as a result of transferring focus between Qt objects), we sometimes need to reconfigure the keyboard. And the way we do that is to create a new QIOSTextResponder that matches the new configuration and tell it to become first responder. And in that process we need to ensure that we don't clear the focus object when the old text responder resigns. After all, it was the one requesting the new IM configuration in the first place. Since we set FirstResponderCandidate to point to the new text responder just before telling the old one to resign, we can use that variable to check if were in a first responder transition before clearing the focus object. Change-Id: I05bfb8180700a92a8f14f496044457583bcd38d3 Reviewed-by: Tor Arne Vestbø <>
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/ios/ b/src/plugins/platforms/ios/
index 6a66bf213e..eb12739e98 100644
--- a/src/plugins/platforms/ios/
+++ b/src/plugins/platforms/ios/
@@ -324,7 +324,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.