From: Rémi Bernon rbernon@codeweavers.com
Fixes IME not working anymore in Diablo IV. --- dlls/win32u/imm.c | 2 +- dlls/win32u/message.c | 6 ++++++ dlls/win32u/spy.c | 1 + dlls/winex11.drv/xim.c | 8 ++++---- include/ntuser.h | 1 + 5 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/dlls/win32u/imm.c b/dlls/win32u/imm.c index 4a9aca22360..99dc3e5e225 100644 --- a/dlls/win32u/imm.c +++ b/dlls/win32u/imm.c @@ -462,7 +462,7 @@ static void post_ime_update( HWND hwnd, UINT cursor_pos, WCHAR *comp_str, WCHAR list_add_tail( &ime_updates, &update->entry ); pthread_mutex_unlock( &imm_mutex );
- NtUserPostMessage( hwnd, WM_IME_NOTIFY, IMN_WINE_SET_COMP_STRING, id ); + NtUserPostMessage( hwnd, WM_WINE_IME_NOTIFY, IMN_WINE_SET_COMP_STRING, id ); } else { diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 24a55365b7a..c5913054f48 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2121,6 +2121,12 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR case WM_WINE_SETCURSOR: FIXME( "Unexpected non-hardware WM_WINE_SETCURSOR message\n" ); return FALSE; + case WM_WINE_IME_NOTIFY: + { + HWND ime_hwnd = get_default_ime_window( hwnd ); + if (!ime_hwnd || ime_hwnd == NtUserGetParent( hwnd )) return 0; + return send_message( ime_hwnd, WM_IME_NOTIFY, wparam, lparam ); + } case WM_WINE_UPDATEWINDOWSTATE: update_window_state( hwnd ); return 0; diff --git a/dlls/win32u/spy.c b/dlls/win32u/spy.c index f546f4b0439..f44771fdb90 100644 --- a/dlls/win32u/spy.c +++ b/dlls/win32u/spy.c @@ -1139,6 +1139,7 @@ static const char * const WINEMessageTypeNames[SPY_MAX_WINEMSGNUM + 1] = "WM_WINE_SETACTIVEWINDOW", "WM_WINE_KEYBOARD_LL_HOOK", "WM_WINE_MOUSE_LL_HOOK", + "WM_WINE_IME_NOTIFY", "WM_WINE_UPDATEWINDOWSTATE", };
diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index 732a55a978a..3871e4e7617 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -128,10 +128,10 @@ static BOOL xic_preedit_state_notify( XIC xic, XPointer user, XPointer arg ) switch (state) { case XIMPreeditEnable: - NtUserPostMessage( hwnd, WM_IME_NOTIFY, IMN_WINE_SET_OPEN_STATUS, TRUE ); + NtUserPostMessage( hwnd, WM_WINE_IME_NOTIFY, IMN_WINE_SET_OPEN_STATUS, TRUE ); break; case XIMPreeditDisable: - NtUserPostMessage( hwnd, WM_IME_NOTIFY, IMN_WINE_SET_OPEN_STATUS, FALSE ); + NtUserPostMessage( hwnd, WM_WINE_IME_NOTIFY, IMN_WINE_SET_OPEN_STATUS, FALSE ); break; }
@@ -147,7 +147,7 @@ static int xic_preedit_start( XIC xic, XPointer user, XPointer arg ) if ((ime_comp_buf = realloc( ime_comp_buf, sizeof(WCHAR) ))) *ime_comp_buf = 0; else ERR( "Failed to allocate preedit buffer\n" );
- NtUserPostMessage( hwnd, WM_IME_NOTIFY, IMN_WINE_SET_OPEN_STATUS, TRUE ); + NtUserPostMessage( hwnd, WM_WINE_IME_NOTIFY, IMN_WINE_SET_OPEN_STATUS, TRUE ); post_ime_update( hwnd, 0, ime_comp_buf, NULL );
return -1; @@ -163,7 +163,7 @@ static int xic_preedit_done( XIC xic, XPointer user, XPointer arg ) ime_comp_buf = NULL;
post_ime_update( hwnd, 0, NULL, NULL ); - NtUserPostMessage( hwnd, WM_IME_NOTIFY, IMN_WINE_SET_OPEN_STATUS, FALSE ); + NtUserPostMessage( hwnd, WM_WINE_IME_NOTIFY, IMN_WINE_SET_OPEN_STATUS, FALSE );
return 0; } diff --git a/include/ntuser.h b/include/ntuser.h index 558dfacea20..538b986693c 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -521,6 +521,7 @@ enum wine_internal_message WM_WINE_SETACTIVEWINDOW, WM_WINE_KEYBOARD_LL_HOOK, WM_WINE_MOUSE_LL_HOOK, + WM_WINE_IME_NOTIFY, WM_WINE_UPDATEWINDOWSTATE, WM_WINE_FIRST_DRIVER_MSG = 0x80001000, /* range of messages reserved for the USER driver */ WM_WINE_CLIPCURSOR = 0x80001ff0, /* internal driver notification messages */