diff --git a/src/win32_window.c b/src/win32_window.c index d2c7218b..d3816363 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -636,26 +636,26 @@ static GLFWbool getImmPreedit(_GLFWwindow* window) return GLFW_TRUE; } -static GLFWbool commitImmPreedit(_GLFWwindow* window) +static GLFWbool commitImmResultStr(_GLFWwindow* window) { HIMC hIMC; - LONG preeditBytes; + LONG bytes; if (!window->callbacks.character) return GLFW_FALSE; hIMC = ImmGetContext(window->win32.handle); // get preedit data sizes - preeditBytes = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, NULL, 0); + bytes = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, NULL, 0); - if (preeditBytes > 0) + if (bytes > 0) { int i; - int length = preeditBytes / sizeof(WCHAR); - LPWSTR buffer = _glfw_calloc(preeditBytes, 1); + int length = bytes / sizeof(WCHAR); + LPWSTR buffer = _glfw_calloc(bytes, 1); // get preedit data - ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, buffer, preeditBytes); + ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, buffer, bytes); for (i = 0; i < length; i++) window->callbacks.character((GLFWwindow*) window, buffer[i]); @@ -968,7 +968,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l window->nblocks = 0; window->ntext = 0; _glfwInputPreedit(window, 0); - commitImmPreedit(window); + commitImmResultStr(window); return TRUE; } if (lParam & GCS_COMPSTR)