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 17:28:11 +0000
commitaa5336db609d745f43764b37f05d1c445da559fa (patch)
treee2fd27441fa7addfd27a7d10c4dbc1e94c2aa106
parent714872808a588b83cb3d3632f3cefe824319ff33 (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.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> (cherry picked from commit 7171c5fba2923d409530ff48d994b895846292ac)
-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) {