From 4156b55cf91a7cb90fd14582a1c5a9df5792933e Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sun, 31 Mar 2024 21:30:30 +0100 Subject: [PATCH] textinput: send deactivate on disable ti ref #5288 --- src/managers/input/TextInput.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/managers/input/TextInput.cpp b/src/managers/input/TextInput.cpp index eeea899d..6b6f38c8 100644 --- a/src/managers/input/TextInput.cpp +++ b/src/managers/input/TextInput.cpp @@ -96,6 +96,9 @@ void CTextInput::onDisabled() { hyprListener_surfaceDestroyed.removeCallback(); hyprListener_surfaceUnmapped.removeCallback(); + if (!g_pInputManager->m_sIMERelay.m_pWLRIME->active) + return; + wlr_input_method_v2_send_deactivate(g_pInputManager->m_sIMERelay.m_pWLRIME); g_pInputManager->m_sIMERelay.commitIMEState(this); } @@ -204,6 +207,12 @@ void CTextInput::leave() { } setFocusedSurface(nullptr); + + if (!g_pInputManager->m_sIMERelay.m_pWLRIME->active) + return; + + wlr_input_method_v2_send_deactivate(g_pInputManager->m_sIMERelay.m_pWLRIME); + g_pInputManager->m_sIMERelay.commitIMEState(this); } wlr_surface* CTextInput::focusedSurface() {