From 575448a77a211101e73661179d40a32dd5c823b8 Mon Sep 17 00:00:00 2001 From: Inho Lee Date: Fri, 2 Feb 2024 10:32:17 +0100 Subject: [PATCH] QtTextInputMethod: hide inputPanel when focus leaving When focusObject is changed, hide the input panel if input method is not accepted. Fixes: QTBUG-116600 Pick-to: 6.7 6.6 6.5 Change-Id: I50b5d051eea6f85365d8bc9aeadb46d8d866e362 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/plugins/platforms/wayland/qwaylandinputmethodcontext.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/platforms/wayland/qwaylandinputmethodcontext.cpp b/src/plugins/platforms/wayland/qwaylandinputmethodcontext.cpp index 657208efbf1..2733e4f3aab 100644 --- a/src/plugins/platforms/wayland/qwaylandinputmethodcontext.cpp +++ b/src/plugins/platforms/wayland/qwaylandinputmethodcontext.cpp @@ -362,6 +362,9 @@ void QWaylandInputMethodContext::setFocusObject(QObject *) if (inputMethod == nullptr) return; + if (inputMethod->isVisible() && !inputMethodAccepted()) + inputMethod->hide_input_panel(); + QWindow *window = QGuiApplication::focusWindow(); if (m_currentWindow != nullptr && m_currentWindow->handle() != nullptr) {