Skip to content

Commit

Permalink
textinput: fix tiv3 leave (#7761)
Browse files Browse the repository at this point in the history
  • Loading branch information
sungyoonc authored Sep 12, 2024
1 parent 73b9756 commit 118be4d
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/managers/input/TextInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,12 @@ void CTextInput::setFocusedSurface(SP<CWLSurfaceResource> pSurface) {
listeners.surfaceUnmap.reset();
listeners.surfaceDestroy.reset();

if (isV3() && !pV3Input.expired() && pV3Input->current.enabled.value)
pV3Input->current.enabled.value = false;
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;
}

if (!g_pInputManager->m_sIMERelay.getFocusedTextInput())
g_pInputManager->m_sIMERelay.deactivateIME(this);
Expand All @@ -154,8 +158,12 @@ void CTextInput::setFocusedSurface(SP<CWLSurfaceResource> pSurface) {
listeners.surfaceUnmap.reset();
listeners.surfaceDestroy.reset();

if (isV3() && !pV3Input.expired() && pV3Input->current.enabled.value)
pV3Input->current.enabled.value = false;
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;
}

if (!g_pInputManager->m_sIMERelay.getFocusedTextInput())
g_pInputManager->m_sIMERelay.deactivateIME(this);
Expand Down Expand Up @@ -202,13 +210,9 @@ void CTextInput::leave() {
enterLocks = 0;
}

if (isV3()) {
if (isV3())
pV3Input->leave(focusedSurface());
if (pV3Input->current.enabled.value) {
pV3Input->current.enabled.value = false;
onDisabled();
}
} else
else
pV1Input->leave();

setFocusedSurface(nullptr);
Expand Down

0 comments on commit 118be4d

Please sign in to comment.