diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 3d85f47f34..1d2941e126 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -3904,6 +3904,7 @@ void QGuiApplicationPrivate::_q_updateFocusObject(QObject *object)
 
     QPlatformInputContext *inputContext = platformIntegration()->inputContext();
     bool enabled = false;
+    qDebug() <<  '\n' << __FUNCTION__ << '>' << object;
     if (object && inputContext) {
         QInputMethodQueryEvent query(Qt::ImEnabled | Qt::ImHints);
         QGuiApplication::sendEvent(object, &query);
@@ -3911,10 +3912,13 @@ void QGuiApplicationPrivate::_q_updateFocusObject(QObject *object)
         if (enabled) {
             static const bool supportsHiddenText = inputContext->hasCapability(QPlatformInputContext::HiddenTextCapability);
             const Qt::InputMethodHints hints = static_cast<Qt::InputMethodHints>(query.value(Qt::ImHints).toInt());
-            if ((hints & Qt::ImhHiddenText) && !supportsHiddenText)
+            if ((hints & Qt::ImhHiddenText) && !supportsHiddenText) {
                 enabled = false;
+                qDebug() <<  __FUNCTION__ << "clearing enabled due to !supportsHiddenText";
+            }
         }
     }
+    qDebug() <<  __FUNCTION__ << "<enabled=" << enabled <<  '\n';
 
     QPlatformInputContextPrivate::setInputMethodAccepted(enabled);
     if (inputContext)
diff --git a/src/gui/kernel/qinputmethod.cpp b/src/gui/kernel/qinputmethod.cpp
index 365b088840..9e3939c784 100644
--- a/src/gui/kernel/qinputmethod.cpp
+++ b/src/gui/kernel/qinputmethod.cpp
@@ -315,6 +315,7 @@ Qt::LayoutDirection QInputMethod::inputDirection() const
 void QInputMethod::update(Qt::InputMethodQueries queries)
 {
     Q_D(QInputMethod);
+    qDebug() << __FUNCTION__ << queries;
 
     if (queries & Qt::ImEnabled) {
         QObject *focus = qApp->focusObject();
@@ -397,6 +398,7 @@ bool QInputMethodPrivate::objectAcceptsInputMethod(QObject *object)
         QInputMethodQueryEvent query(Qt::ImEnabled);
         QGuiApplication::sendEvent(object, &query);
         enabled = query.value(Qt::ImEnabled).toBool();
+        qDebug() << __FUNCTION__ << object << "enabled=" << enabled;
     }
 
     return enabled;
@@ -422,7 +424,9 @@ QVariant QInputMethod::queryFocusObject(Qt::InputMethodQuery query, QVariant arg
 
     QInputMethodQueryEvent queryEvent(query);
     QCoreApplication::sendEvent(focusObject, &queryEvent);
-    return queryEvent.value(query);
+    QVariant v = queryEvent.value(query);
+    qDebug() << __FUNCTION__ << focusObject << query << v;
+    return v;
 }
 
 QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.cpp b/src/plugins/platforms/windows/qwindowsinputcontext.cpp
index b9dd2c557e..8d2f1b5d44 100644
--- a/src/plugins/platforms/windows/qwindowsinputcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsinputcontext.cpp
@@ -247,8 +247,14 @@ void QWindowsInputContext::updateEnabled()
 {
     if (!QGuiApplication::focusObject())
         return;
+    QObject *fo = QGuiApplication::focusObject();
+    qDebug() << __FUNCTION__ <<  "fo="
+      << fo << "fowin=" << QGuiApplication::focusWindow();
     if (QWindowsWindow *platformWindow = QWindowsWindow::windowsWindowOf(QGuiApplication::focusWindow())) {
         const bool accepted = inputMethodAccepted();
+        qDebug() << __FUNCTION__ <<     "accepted=" << accepted;
+        if (accepted && fo ->objectName().startsWith(QLatin1String("Password")))
+            qDebug("EEK!");
         if (QWindowsContext::verbose > 1)
             qCDebug(lcQpaInputMethods) << __FUNCTION__ << platformWindow->window() << "accepted=" << accepted;
         QWindowsInputContext::setWindowsImeEnabled(platformWindow, accepted);
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 5eab2d1038..cbfae72577 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -11830,8 +11830,10 @@ void QWidget::setShortcutAutoRepeat(int id, bool enable)
 void QWidget::updateMicroFocus()
 {
     // updating everything since this is currently called for any kind of state change
-    if (this == QGuiApplication::focusObject())
+    if (this == QGuiApplication::focusObject()) {
+        qDebug() << __FUNCTION__ << "update";
         QGuiApplication::inputMethod()->update(Qt::ImQueryAll);
+    }
 }
 
 /*!
