winex11.drv: Handle result string directly.
Kusanagi Kouichi
slash at ac.auone-net.jp
Tue Feb 16 03:51:43 CST 2010
Signed-off-by: Kusanagi Kouichi <slash at ac.auone-net.jp>
---
dlls/winex11.drv/ime.c | 17 +++++++++++++++--
dlls/winex11.drv/x11drv.h | 2 +-
dlls/winex11.drv/xim.c | 4 +---
3 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/dlls/winex11.drv/ime.c b/dlls/winex11.drv/ime.c
index cfb0110..affa435 100644
--- a/dlls/winex11.drv/ime.c
+++ b/dlls/winex11.drv/ime.c
@@ -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);
}
/*****
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 9be93c6..af40a4f 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -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 );
diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c
index 38b0a2c..0e32513 100644
--- a/dlls/winex11.drv/xim.c
+++ b/dlls/winex11.drv/xim.c
@@ -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);
}
--
1.6.6.2
More information about the wine-patches
mailing list