summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiostextresponder.mm
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@theqtcompany.com>2016-04-21 10:14:23 +0200
committerRichard Moe Gustavsen <richard.gustavsen@theqtcompany.com>2016-04-22 06:36:59 +0000
commit8586cccc071240a8eff6c5aa53a90010dae55193 (patch)
tree8c47078678da30c51111df15accd218e21b4d648 /src/plugins/platforms/ios/qiostextresponder.mm
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ø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/ios/qiostextresponder.mm')
-rw-r--r--src/plugins/platforms/ios/qiostextresponder.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm
index 6a66bf213e..eb12739e98 100644
--- a/src/plugins/platforms/ios/qiostextresponder.mm
+++ b/src/plugins/platforms/ios/qiostextresponder.mm
@@ -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.
m_inputContext->clearCurrentFocusObject();