summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiosinputcontext.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/ios/qiosinputcontext.mm')
-rw-r--r--src/plugins/platforms/ios/qiosinputcontext.mm9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm
index 5716ad041e0..8544c497d43 100644
--- a/src/plugins/platforms/ios/qiosinputcontext.mm
+++ b/src/plugins/platforms/ios/qiosinputcontext.mm
@@ -371,7 +371,8 @@ void QIOSInputContext::updateKeyboardState(NSNotification *notification)
// with input-accessory-views. The reason for using frameEnd here (the future state),
// instead of the current state reflected in frameBegin, is that QInputMethod::isVisible()
// is documented to reflect the future state in the case of animated transitions.
- m_keyboardState.keyboardVisible = CGRectIntersectsRect(frameEnd, [UIScreen mainScreen].bounds);
+ m_keyboardState.keyboardVisible = !CGRectIsEmpty(UIScreen.mainScreen.bounds) &&
+ !CGRectIsEmpty(frameEnd) && CGRectIntersectsRect(frameEnd, UIScreen.mainScreen.bounds);
// Used for auto-scroller, and will be used for animation-signal in the future
m_keyboardState.keyboardEndRect = frameEnd;
@@ -639,8 +640,10 @@ void QIOSInputContext::update(Qt::InputMethodQueries updatedProperties)
// focus object. We try to detect code paths that fail this assertion and smooth
// over the situation by doing a manual update of the focus object.
if (qApp->focusObject() != m_imeState.focusObject && updatedProperties != Qt::ImQueryAll) {
- qWarning() << "stale focus object" << static_cast<void *>(m_imeState.focusObject)
- << ", doing manual update";
+ qCWarning(lcQpaInputMethods).verbosity(0) << "Updating input context" << updatedProperties
+ << "with last reported focus object" << m_imeState.focusObject
+ << "but qGuiApp reports" << qApp->focusObject()
+ << "which means someone failed to call QPlatformInputContext::setFocusObject()";
setFocusObject(qApp->focusObject());
return;
}