textinput: send deactivate on disable ti

ref #5288
This commit is contained in:
Vaxry 2024-03-31 21:30:30 +01:00
parent e1e41e5448
commit 4156b55cf9

View file

@ -96,6 +96,9 @@ void CTextInput::onDisabled() {
hyprListener_surfaceDestroyed.removeCallback(); hyprListener_surfaceDestroyed.removeCallback();
hyprListener_surfaceUnmapped.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); wlr_input_method_v2_send_deactivate(g_pInputManager->m_sIMERelay.m_pWLRIME);
g_pInputManager->m_sIMERelay.commitIMEState(this); g_pInputManager->m_sIMERelay.commitIMEState(this);
} }
@ -204,6 +207,12 @@ void CTextInput::leave() {
} }
setFocusedSurface(nullptr); 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() { wlr_surface* CTextInput::focusedSurface() {