From d8f35c3552fdbff2305fb51495d2a104f40b83ef Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Wed, 1 Jun 2022 09:06:24 +0900 Subject: [PATCH] Win32: Move preedit clearing process to WM_IME_ENDCOMPOSITION This enables to clear preedit in cases other than committing, such as deleting all preedit texts. --- src/win32_window.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/win32_window.c b/src/win32_window.c index 37639e04..85c62a61 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -993,9 +993,6 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l { if (lParam & GCS_RESULTSTR) { - window->nblocks = 0; - window->ntext = 0; - _glfwInputPreedit(window, 0, 0); commitImmResultStr(window); return TRUE; } @@ -1008,6 +1005,11 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l } break; } + case WM_IME_ENDCOMPOSITION: + window->nblocks = 0; + window->ntext = 0; + _glfwInputPreedit(window, 0, 0); + return TRUE; case WM_IME_NOTIFY: if (wParam == IMN_SETOPENSTATUS) _glfwInputIMEStatus(window);