summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInho Lee <inho.lee@qt.io>2024-02-02 10:32:17 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-02-06 10:14:00 +0000
commit7171c5fba2923d409530ff48d994b895846292ac (patch)
treead721686a169bd3e390a78b89568c6b8b9838d4f
parent4adb2b24ff54ab682ca55e67a7bfb8dc1231c941 (diff)
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.6 6.5 Change-Id: I50b5d051eea6f85365d8bc9aeadb46d8d866e362 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 80c23a2a17c401df159d5e11a1b357a182d1b925) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/client/qwaylandinputmethodcontext.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/client/qwaylandinputmethodcontext.cpp b/src/client/qwaylandinputmethodcontext.cpp
index f03d8fb74..9e037faf2 100644
--- a/src/client/qwaylandinputmethodcontext.cpp
+++ b/src/client/qwaylandinputmethodcontext.cpp
@@ -361,6 +361,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) {