winex11.drv: Generate WM_IME_ENDCOMPOSITION when preedit ends.

This commit is contained in:
Kusanagi Kouichi 2008-04-18 21:52:20 +09:00 committed by Alexandre Julliard
parent a629a4199e
commit 9462190b99
1 changed files with 15 additions and 3 deletions

View File

@ -687,16 +687,22 @@ BOOL WINAPI NotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
TRACE("IMC_SETOPENSTATUS\n");
myPrivate = (LPIMEPRIVATE)ImmLockIMCC(lpIMC->hPrivate);
if (lpIMC->fOpen != myPrivate->bInternalState)
if (lpIMC->fOpen != myPrivate->bInternalState &&
myPrivate->bInComposition)
{
if(lpIMC->fOpen == FALSE)
{
X11DRV_ForceXIMReset(lpIMC->hWnd);
GenerateIMEMessage(hIMC,WM_IME_ENDCOMPOSITION,0,0);
myPrivate->bInComposition = FALSE;
}
else
{
GenerateIMEMessage(hIMC,WM_IME_STARTCOMPOSITION,0,0);
GenerateIMEMessage(hIMC, WM_IME_COMPOSITION, 0, 0);
}
}
myPrivate->bInternalState = lpIMC->fOpen;
bRet = TRUE;
}
break;
@ -963,12 +969,18 @@ void IME_SetOpenStatus(BOOL fOpen)
ImmDestroyIMCC(lpIMC->hCompStr);
lpIMC->hCompStr = ImeCreateBlankCompStr();
}
myPrivate->bInternalState = fOpen;
ImmUnlockIMCC(lpIMC->hPrivate);
UnlockRealIMC(FROM_X11);
ImmSetOpenStatus(RealIMC(FROM_X11), fOpen);
if (myPrivate->bInComposition && fOpen == FALSE)
{
GenerateIMEMessage(FROM_X11, WM_IME_ENDCOMPOSITION, 0, 0);
myPrivate->bInComposition = FALSE;
}
if (!myPrivate->bInternalState && fOpen == TRUE)
ImmSetOpenStatus(RealIMC(FROM_X11), fOpen);
}
void IME_XIMPresent(BOOL present)