From eb97d949aa31b900d9735bcb8ead47acddc1f339 Mon Sep 17 00:00:00 2001 From: Sungyoon Cho Date: Mon, 16 Sep 2024 01:31:38 +0900 Subject: [PATCH] textinput: don't reset if ti isn't enabled (#7798) --- src/managers/input/TextInput.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/managers/input/TextInput.cpp b/src/managers/input/TextInput.cpp index e601ad9a..f7a6a350 100644 --- a/src/managers/input/TextInput.cpp +++ b/src/managers/input/TextInput.cpp @@ -99,6 +99,13 @@ void CTextInput::onReset() { if (g_pInputManager->m_sIMERelay.m_pIME.expired()) return; + if (!focusedSurface()) + return; + + const auto PFOCUSEDTI = g_pInputManager->m_sIMERelay.getFocusedTextInput(); + if (!PFOCUSEDTI || PFOCUSEDTI != this) + return; + g_pInputManager->m_sIMERelay.deactivateIME(this, false); g_pInputManager->m_sIMERelay.activateIME(this); }