Module: wine Branch: master Commit: b8dc1e7cde64c212882958c0806b50911a360fb9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=b8dc1e7cde64c212882958c080... Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Wed Nov 15 00:18:51 2017 +0900 winex11: Keep the result string in the IME UI window procedure. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/imm32/tests/imm32.c | 1 - dlls/winex11.drv/ime.c | 11 +++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c index bf0f4b2..12e8f99 100644 --- a/dlls/imm32/tests/imm32.c +++ b/dlls/imm32/tests/imm32.c @@ -380,7 +380,6 @@ static LRESULT WINAPI test_ime_wnd_proc(HWND hWnd, UINT msg, WPARAM wParam, LPAR imc = ImmGetContext(hWnd); size = ImmGetCompositionStringW(imc, GCS_RESULTSTR, wstring, sizeof(wstring)); - todo_wine ok(size > 0, "ImmGetCompositionString(GCS_RESULTSTR) is %d\n", size); ImmReleaseContext(hwnd, imc); diff --git a/dlls/winex11.drv/ime.c b/dlls/winex11.drv/ime.c index 0f4d2b2..d0746c5 100644 --- a/dlls/winex11.drv/ime.c +++ b/dlls/winex11.drv/ime.c @@ -906,6 +906,11 @@ BOOL WINAPI ImeSetCompositionString(HIMC hIMC, DWORD dwIndex, LPCVOID lpComp, myPrivate->bInComposition = TRUE; } + /* clear existing result */ + newCompStr = updateResultStr(lpIMC->hCompStr, NULL, 0); + ImmDestroyIMCC(lpIMC->hCompStr); + lpIMC->hCompStr = newCompStr; + flags = GCS_COMPSTR; if (dwCompLen && lpComp) @@ -1256,7 +1261,6 @@ static void DefaultIMEComposition(HIMC hIMC, HWND hwnd, LPARAM lParam) LPCOMPOSITIONSTRING compstr; LPBYTE compdata; LPWSTR ResultStr; - HIMCC newCompStr; LPINPUTCONTEXT lpIMC; lpIMC = LockRealIMC(hIMC); @@ -1269,11 +1273,6 @@ static void DefaultIMEComposition(HIMC hIMC, HWND hwnd, LPARAM lParam) ResultStr = (LPWSTR)(compdata + compstr->dwResultStrOffset); GenerateIMECHARMessages(hIMC, ResultStr, compstr->dwResultStrLen); ImmUnlockIMCC(lpIMC->hCompStr); - - /* clear the buffer */ - newCompStr = updateResultStr(lpIMC->hCompStr, NULL, 0); - ImmDestroyIMCC(lpIMC->hCompStr); - lpIMC->hCompStr = newCompStr; UnlockRealIMC(hIMC); } else