Aric Stewart : winex11.drv: Improve setting IME result text with no composition.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Apr 25 09:47:13 CDT 2016
Module: wine
Branch: master
Commit: e4d94e48138ff4963e1b896d392e6fa6b9b87054
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e4d94e48138ff4963e1b896d392e6fa6b9b87054
Author: Aric Stewart <aric at codeweavers.com>
Date: Fri Apr 22 13:59:03 2016 -0500
winex11.drv: Improve setting IME result text with no composition.
This greatly improves behaviors around deadkeys in Microsoft Word.
Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/winex11.drv/ime.c | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/dlls/winex11.drv/ime.c b/dlls/winex11.drv/ime.c
index 22698cf..ee622c1 100644
--- a/dlls/winex11.drv/ime.c
+++ b/dlls/winex11.drv/ime.c
@@ -1046,24 +1046,38 @@ void IME_SetResultString(LPWSTR lpResult, DWORD dwResultLen)
LPINPUTCONTEXT lpIMC;
HIMCC newCompStr;
LPIMEPRIVATE myPrivate;
+ BOOL inComp;
imc = RealIMC(FROM_X11);
lpIMC = ImmLockIMC(imc);
if (lpIMC == NULL)
return;
+ newCompStr = updateCompStr(lpIMC->hCompStr, NULL, 0);
+ ImmDestroyIMCC(lpIMC->hCompStr);
+ lpIMC->hCompStr = newCompStr;
+
newCompStr = updateResultStr(lpIMC->hCompStr, lpResult, dwResultLen);
ImmDestroyIMCC(lpIMC->hCompStr);
lpIMC->hCompStr = newCompStr;
myPrivate = ImmLockIMCC(lpIMC->hPrivate);
- if (!myPrivate->bInComposition)
- GenerateIMEMessage(imc, WM_IME_STARTCOMPOSITION, 0, 0);
- GenerateIMEMessage(imc, WM_IME_COMPOSITION, 0, GCS_RESULTSTR);
- if (!myPrivate->bInComposition)
- GenerateIMEMessage(imc, WM_IME_ENDCOMPOSITION, 0, 0);
+ inComp = myPrivate->bInComposition;
ImmUnlockIMCC(lpIMC->hPrivate);
+ if (!inComp)
+ {
+ ImmSetOpenStatus(imc, TRUE);
+ GenerateIMEMessage(imc, WM_IME_STARTCOMPOSITION, 0, 0);
+ }
+
+ GenerateIMEMessage(imc, WM_IME_COMPOSITION, 0, GCS_COMPSTR);
+ GenerateIMEMessage(imc, WM_IME_COMPOSITION, lpResult[0], GCS_RESULTSTR|GCS_RESULTCLAUSE);
+ GenerateIMEMessage(imc, WM_IME_ENDCOMPOSITION, 0, 0);
+
+ if (!inComp)
+ ImmSetOpenStatus(imc, FALSE);
+
ImmUnlockIMC(imc);
}
More information about the wine-cvs
mailing list