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.
This commit is contained in:
Daijiro Fukuda 2022-06-01 09:06:24 +09:00
parent 0ba4b36557
commit d8f35c3552

View File

@ -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);