winemac: Keep the result string in the IME UI window procedure.

This is winemac.drv port from winex11.drv.
Please refer to b8dc1e7cde.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Akihiro Sagawa 2017-11-17 00:12:13 +09:00 committed by Alexandre Julliard
parent 0c7d67c5fa
commit fdd376e514
1 changed files with 5 additions and 6 deletions

View File

@ -965,6 +965,11 @@ static BOOL IME_SetCompositionString(void* 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)
@ -1166,7 +1171,6 @@ static void DefaultIMEComposition(HIMC hIMC, HWND hwnd, LPARAM lParam)
LPCOMPOSITIONSTRING compstr;
LPBYTE compdata;
LPWSTR ResultStr;
HIMCC newCompStr;
LPINPUTCONTEXT lpIMC;
lpIMC = LockRealIMC(hIMC);
@ -1179,11 +1183,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