vcl/win/window/salframe.cxx | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit b5228a1880cdb4774deb2156e72890711a02b4bc Author: Jonathan Clark <[email protected]> AuthorDate: Fri Aug 1 04:07:12 2025 -0600 Commit: Xisco Fauli <[email protected]> CommitDate: Thu Aug 7 13:51:23 2025 +0200 tdf#167740 vcl: Fix Win IME inserting stale composition after dismissal Related to tdf#155158: Previously, the Microsoft Pinyin IME failed to send WM_IME_ENDCOMPOSITION when dismissed during composition. As a result of this, LO became stuck in an IME input state (resulting in, for example, an invisible cursor). The fix for this bug was to treat dismissing the IME in this state as also ending composition. Unfortunately, in the case of the Windows 10 Microsoft Korean IME, this bug fix caused the last character to be repeated due to stale composition state. This change updates the previous fix to also clear this data prior to ending composition. Change-Id: I5b2906c54af495e238a8335cc9c21cb42f6f3beb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188754 Tested-by: Jenkins Reviewed-by: Jonathan Clark <[email protected]> (cherry picked from commit af0da68b4176aaf6d2f6faed66446e5638f41c80) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189045 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index 342fffbefe46..918a92af09d4 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -5321,6 +5321,12 @@ static bool ImplHandleIMEEndComposition( HWND hWnd ) // tdf#155158: Windows IMEs do not necessarily send a composition message if they are // dismissed during composition (for example, by an input method/language change). + // tdf#167740: Also clear the candidate text when the IME is dismissed. + SalExtTextInputEvent aEvt; + aEvt.mpTextAttr = nullptr; + aEvt.mnCursorPos = 0; + aEvt.mnCursorFlags = 0; + pFrame->CallCallback(SalEvent::ExtTextInput, &aEvt); pFrame->CallCallback(SalEvent::EndExtTextInput, nullptr); }
