From bed25d8a3a27a439e5a50083be6b7218a8982d3c Mon Sep 17 00:00:00 2001
From: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Date: Tue, 4 Nov 2014 14:08:33 +0100
Subject: [PATCH] iOS: let focusobject be ImEnabled when a menu is attached
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Since the picker menu uses IM to set an alternative
input view, we also need to specify that we IM is enabled.

Task-number: QTBUG-42523
Change-Id: Ia559fbc0ca7e6a1a4499d5eb179baa2d915ecb17
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
---
 src/plugins/platforms/ios/qiosmenu.mm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/plugins/platforms/ios/qiosmenu.mm b/src/plugins/platforms/ios/qiosmenu.mm
index 005b06547e6..f64c1a2f418 100644
--- a/src/plugins/platforms/ios/qiosmenu.mm
+++ b/src/plugins/platforms/ios/qiosmenu.mm
@@ -452,11 +452,11 @@ void QIOSMenu::toggleShowUsingUIPickerView(bool show)
         Q_ASSERT(!focusObjectWithPickerView);
         focusObjectWithPickerView = qApp->focusWindow()->focusObject();
         focusObjectWithPickerView->installEventFilter(this);
-        qApp->inputMethod()->update(Qt::ImPlatformData);
+        qApp->inputMethod()->update(Qt::ImEnabled | Qt::ImPlatformData);
     } else {
         Q_ASSERT(focusObjectWithPickerView);
         focusObjectWithPickerView->removeEventFilter(this);
-        qApp->inputMethod()->update(Qt::ImPlatformData);
+        qApp->inputMethod()->update(Qt::ImEnabled | Qt::ImPlatformData);
         focusObjectWithPickerView = 0;
 
         Q_ASSERT(m_pickerView);
@@ -477,6 +477,7 @@ bool QIOSMenu::eventFilter(QObject *obj, QEvent *event)
             imPlatformData.insert(kImePlatformDataInputView, QVariant::fromValue(static_cast<void *>(m_pickerView)));
             imPlatformData.insert(kImePlatformDataInputAccessoryView, QVariant::fromValue(static_cast<void *>(m_pickerView.toolbar)));
             queryEvent->setValue(Qt::ImPlatformData, imPlatformData);
+            queryEvent->setValue(Qt::ImEnabled, true);
 
             return true;
         }
-- 
GitLab