winex11.drv: Handle result string directly.

This commit is contained in:
Kusanagi Kouichi 2010-02-16 18:51:43 +09:00 committed by Alexandre Julliard
parent d3aa514a2d
commit 4ccbcb02b2
3 changed files with 17 additions and 6 deletions

View File

@ -1049,9 +1049,22 @@ BOOL IME_SetCompositionString(DWORD dwIndex, LPCVOID lpComp, DWORD dwCompLen,
lpRead, dwReadLen);
}
BOOL IME_NotifyIME(DWORD dwAction, DWORD dwIndex, DWORD dwValue)
void IME_SetResultString(LPWSTR lpResult, DWORD dwResultLen)
{
return NotifyIME(FROM_X11, dwAction, dwIndex, dwValue);
LPINPUTCONTEXT lpIMC;
HIMCC newCompStr;
lpIMC = LockRealIMC(FROM_X11);
if (lpIMC == NULL)
return;
newCompStr = updateResultStr(lpIMC->hCompStr, lpResult, dwResultLen);
ImmDestroyIMCC(lpIMC->hCompStr);
lpIMC->hCompStr = newCompStr;
GenerateIMEMessage(FROM_X11, WM_IME_COMPOSITION, 0, GCS_RESULTSTR);
UnlockRealIMC(FROM_X11);
}
/*****

View File

@ -307,7 +307,7 @@ extern void IME_UpdateAssociation(HWND focus);
extern BOOL IME_SetCompositionString(DWORD dwIndex, LPCVOID lpComp,
DWORD dwCompLen, LPCVOID lpRead,
DWORD dwReadLen);
extern BOOL IME_NotifyIME(DWORD dwAction, DWORD dwIndex, DWORD dwValue);
extern void IME_SetResultString(LPWSTR lpResult, DWORD dwResultlen);
extern void X11DRV_XDND_EnterEvent( HWND hWnd, XClientMessageEvent *event );
extern void X11DRV_XDND_PositionEvent( HWND hWnd, XClientMessageEvent *event );

View File

@ -116,9 +116,7 @@ void X11DRV_XIMLookupChars( const char *str, DWORD count )
if ((focus = GetFocus()))
IME_UpdateAssociation(focus);
IME_SetCompositionString(SCS_SETSTR, wcOutput,
sizeof (WCHAR) * dwOutput, NULL, 0);
IME_NotifyIME(NI_COMPOSITIONSTR, CPS_COMPLETE, 0);
IME_SetResultString(wcOutput, dwOutput);
HeapFree(GetProcessHeap(), 0, wcOutput);
}