From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winex11.drv/ime.c | 9 ++++++--- dlls/winex11.drv/unixlib.h | 9 +++++++++ dlls/winex11.drv/x11drv.h | 4 ++-- dlls/winex11.drv/x11drv_main.c | 2 ++ dlls/winex11.drv/xim.c | 13 ++++++++----- 5 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/dlls/winex11.drv/ime.c b/dlls/winex11.drv/ime.c index c1584930861..1656601577d 100644 --- a/dlls/winex11.drv/ime.c +++ b/dlls/winex11.drv/ime.c @@ -637,6 +637,7 @@ UINT WINAPI ImeToAsciiEx (UINT uVKey, UINT uScanCode, const LPBYTE lpbKeyState,
BOOL WINAPI NotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue) { + struct xim_preedit_state_params preedit_params; BOOL bRet = FALSE; LPINPUTCONTEXT lpIMC;
@@ -680,7 +681,9 @@ BOOL WINAPI NotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue) TRACE("IMC_SETOPENSTATUS\n");
bRet = TRUE; - X11DRV_SetPreeditState(lpIMC->hWnd, lpIMC->fOpen); + preedit_params.hwnd = lpIMC->hWnd; + preedit_params.open = lpIMC->fOpen; + X11DRV_CALL( xim_preedit_state, &preedit_params ); if (!lpIMC->fOpen) { LPIMEPRIVATE myPrivate; @@ -688,7 +691,7 @@ BOOL WINAPI NotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue) myPrivate = ImmLockIMCC(lpIMC->hPrivate); if (myPrivate->bInComposition) { - X11DRV_ForceXIMReset(lpIMC->hWnd); + X11DRV_CALL( xim_reset, lpIMC->hWnd ); GenerateIMEMessage(hIMC, WM_IME_ENDCOMPOSITION, 0, 0); myPrivate->bInComposition = FALSE; } @@ -764,7 +767,7 @@ BOOL WINAPI NotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
TRACE("CPS_CANCEL\n");
- X11DRV_ForceXIMReset(lpIMC->hWnd); + X11DRV_CALL( xim_reset, lpIMC->hWnd );
if (lpIMC->hCompStr) ImmDestroyIMCC(lpIMC->hCompStr); diff --git a/dlls/winex11.drv/unixlib.h b/dlls/winex11.drv/unixlib.h index 062bb59c663..2a957af0f56 100644 --- a/dlls/winex11.drv/unixlib.h +++ b/dlls/winex11.drv/unixlib.h @@ -28,6 +28,8 @@ enum x11drv_funcs unix_tablet_get_packet, unix_tablet_info, unix_tablet_load_info, + unix_xim_preedit_state, + unix_xim_reset, unix_funcs_count, };
@@ -59,6 +61,13 @@ struct tablet_info_params void *output; };
+/* x11drv_xim_preedit_state params */ +struct xim_preedit_state_params +{ + HWND hwnd; + BOOL open; +}; + /* DnD support */
struct format_entry diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 08bfa6dd1d5..c6e5044c110 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -827,8 +827,6 @@ extern BOOL X11DRV_InitXIM( const WCHAR *input_style ) DECLSPEC_HIDDEN; extern XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data) DECLSPEC_HIDDEN; extern void X11DRV_SetupXIM(void) DECLSPEC_HIDDEN; extern void X11DRV_XIMLookupChars( const char *str, DWORD count ) DECLSPEC_HIDDEN; -extern void X11DRV_ForceXIMReset(HWND hwnd) DECLSPEC_HIDDEN; -extern void X11DRV_SetPreeditState(HWND hwnd, BOOL fOpen) DECLSPEC_HIDDEN;
#define XEMBED_MAPPED (1 << 0)
@@ -849,6 +847,8 @@ extern NTSTATUS x11drv_tablet_attach_queue( void *arg ) DECLSPEC_HIDDEN; extern NTSTATUS x11drv_tablet_get_packet( void *arg ) DECLSPEC_HIDDEN; extern NTSTATUS x11drv_tablet_load_info( void *arg ) DECLSPEC_HIDDEN; extern NTSTATUS x11drv_tablet_info( void *arg ) DECLSPEC_HIDDEN; +extern NTSTATUS x11drv_xim_preedit_state( void *arg ) DECLSPEC_HIDDEN; +extern NTSTATUS x11drv_xim_reset( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS WINAPI x11drv_post_drop( void *data, ULONG size ) DECLSPEC_HIDDEN;
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index cc565bd30a7..22f0f0a729f 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -962,6 +962,8 @@ const unixlib_entry_t __wine_unix_call_funcs[] = x11drv_tablet_get_packet, x11drv_tablet_info, x11drv_tablet_load_info, + x11drv_xim_preedit_state, + x11drv_xim_reset, };
diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index ec4be2e0c5d..81f420891ad 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -241,7 +241,7 @@ static void XIMPreEditCaretCallback(XIC ic, XPointer client_data, TRACE("Finished\n"); }
-void X11DRV_ForceXIMReset(HWND hwnd) +NTSTATUS x11drv_xim_reset( void *hwnd ) { XIC ic = X11DRV_get_ic(hwnd); if (ic) @@ -251,19 +251,21 @@ void X11DRV_ForceXIMReset(HWND hwnd) leftover = XmbResetIC(ic); XFree(leftover); } + return 0; }
-void X11DRV_SetPreeditState(HWND hwnd, BOOL fOpen) +NTSTATUS x11drv_xim_preedit_state( void *arg ) { + struct xim_preedit_state_params *params = arg; XIC ic; XIMPreeditState state; XVaNestedList attr;
- ic = X11DRV_get_ic(hwnd); + ic = X11DRV_get_ic( params->hwnd ); if (!ic) - return; + return 0;
- if (fOpen) + if (params->open) state = XIMPreeditEnable; else state = XIMPreeditDisable; @@ -274,6 +276,7 @@ void X11DRV_SetPreeditState(HWND hwnd, BOOL fOpen) XSetICValues(ic, XNPreeditAttributes, attr, NULL); XFree(attr); } + return 0; }