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@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
881fd6a565
commit
e4d94e4813
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue