winex11: Generate WM_IME_ENDCOMPOSITION when composition string is canceled.

This commit is contained in:
Kusanagi Kouichi 2008-04-24 08:29:54 +09:00 committed by Alexandre Julliard
parent d8e3d181d1
commit 4baf6e7edc
1 changed files with 6 additions and 12 deletions

View File

@ -769,25 +769,19 @@ BOOL WINAPI NotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
case CPS_REVERT: FIXME("CPS_REVERT\n"); break;
case CPS_CANCEL:
{
BOOL send;
LPCOMPOSITIONSTRING lpCompStr;
LPIMEPRIVATE myPrivate;
TRACE("CPS_CANCEL\n");
X11DRV_ForceXIMReset(lpIMC->hWnd);
lpCompStr = ImmLockIMCC(lpIMC->hCompStr);
send = (lpCompStr->dwCompStrLen != 0);
ImmUnlockIMCC(lpIMC->hCompStr);
if (send)
myPrivate = (LPIMEPRIVATE)ImmLockIMCC(lpIMC->hPrivate);
if (myPrivate->bInComposition)
{
HIMCC newCompStr;
newCompStr = updateCompStr(lpIMC->hCompStr, NULL, 0);
ImmDestroyIMCC(lpIMC->hCompStr);
lpIMC->hCompStr = newCompStr;
GenerateIMEMessage(hIMC, WM_IME_COMPOSITION, 0, GCS_COMPSTR);
GenerateIMEMessage(hIMC, WM_IME_ENDCOMPOSITION, 0, 0);
myPrivate->bInComposition = FALSE;
}
ImmUnlockIMCC(lpIMC->hPrivate);
bRet = TRUE;
}
break;