textinput: don't reset if ti isn't enabled (#7798)

This commit is contained in:
Sungyoon Cho 2024-09-16 01:31:38 +09:00 committed by GitHub
parent e74efd87e5
commit eb97d949aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
}