textinput: fix tiv3 leave (#7761)

This commit is contained in:
Sungyoon Cho 2024-09-13 01:41:24 +09:00 committed by GitHub
parent 73b9756b8d
commit 118be4dea0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -138,8 +138,12 @@ void CTextInput::setFocusedSurface(SP<CWLSurfaceResource> pSurface) {
listeners.surfaceUnmap.reset(); listeners.surfaceUnmap.reset();
listeners.surfaceDestroy.reset(); listeners.surfaceDestroy.reset();
if (isV3() && !pV3Input.expired() && pV3Input->current.enabled.value) if (isV3() && !pV3Input.expired() && pV3Input->current.enabled.value) {
pV3Input->pending.enabled.value = false;
pV3Input->pending.enabled.isDisablePending = false;
pV3Input->pending.enabled.isEnablePending = false;
pV3Input->current.enabled.value = false; pV3Input->current.enabled.value = false;
}
if (!g_pInputManager->m_sIMERelay.getFocusedTextInput()) if (!g_pInputManager->m_sIMERelay.getFocusedTextInput())
g_pInputManager->m_sIMERelay.deactivateIME(this); g_pInputManager->m_sIMERelay.deactivateIME(this);
@ -154,8 +158,12 @@ void CTextInput::setFocusedSurface(SP<CWLSurfaceResource> pSurface) {
listeners.surfaceUnmap.reset(); listeners.surfaceUnmap.reset();
listeners.surfaceDestroy.reset(); listeners.surfaceDestroy.reset();
if (isV3() && !pV3Input.expired() && pV3Input->current.enabled.value) if (isV3() && !pV3Input.expired() && pV3Input->current.enabled.value) {
pV3Input->pending.enabled.value = false;
pV3Input->pending.enabled.isDisablePending = false;
pV3Input->pending.enabled.isEnablePending = false;
pV3Input->current.enabled.value = false; pV3Input->current.enabled.value = false;
}
if (!g_pInputManager->m_sIMERelay.getFocusedTextInput()) if (!g_pInputManager->m_sIMERelay.getFocusedTextInput())
g_pInputManager->m_sIMERelay.deactivateIME(this); g_pInputManager->m_sIMERelay.deactivateIME(this);
@ -202,13 +210,9 @@ void CTextInput::leave() {
enterLocks = 0; enterLocks = 0;
} }
if (isV3()) { if (isV3())
pV3Input->leave(focusedSurface()); pV3Input->leave(focusedSurface());
if (pV3Input->current.enabled.value) { else
pV3Input->current.enabled.value = false;
onDisabled();
}
} else
pV1Input->leave(); pV1Input->leave();
setFocusedSurface(nullptr); setFocusedSurface(nullptr);