Jacek Caban : imm32: Use default IME window WM_DESTROY to call imm_couninit_thread.
Alexandre Julliard
julliard at winehq.org
Mon Jul 11 15:51:39 CDT 2022
Module: wine
Branch: master
Commit: 8f3e19a52f4cb373ef0225a1bcab4fb9ae06a851
URL: https://gitlab.winehq.org/wine/wine/-/commit/8f3e19a52f4cb373ef0225a1bcab4fb9ae06a851
Author: Jacek Caban <jacek at codeweavers.com>
Date: Fri Jul 8 14:20:52 2022 +0200
imm32: Use default IME window WM_DESTROY to call imm_couninit_thread.
---
dlls/imm32/imm.c | 9 ++++++++-
dlls/user32/tests/win.c | 1 -
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c
index d290e580a23..42cf6a712f9 100644
--- a/dlls/imm32/imm.c
+++ b/dlls/imm32/imm.c
@@ -1028,7 +1028,6 @@ static HWND imm_detach_default_window(IMMThreadData *thread_data)
to_destroy = thread_data->hwndDefault;
thread_data->hwndDefault = NULL;
thread_data->windowRefs = 0;
- imm_couninit_thread(TRUE);
return to_destroy;
}
@@ -3470,6 +3469,14 @@ LRESULT WINAPI __wine_ime_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lp
init_messages();
return TRUE;
+ case WM_DESTROY:
+ {
+ HWND default_hwnd = ImmGetDefaultIMEWnd(0);
+ if (!default_hwnd || hwnd == default_hwnd)
+ imm_couninit_thread(TRUE);
+ }
+ return TRUE;
+
case WM_IME_INTERNAL:
return ime_internal_msg(wparam, lparam);
}
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 3727efb1b41..4c2af09d0c6 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -3760,7 +3760,6 @@ static void test_SetActiveWindow_0_proc( char **argv )
else /* < Win10 */
{
ok( tmp == hwnd, "SetActiveWindow returned %p\n", tmp );
- todo_wine
ok( GetLastError() == 0, "got error %lu\n", GetLastError() );
tmp = GetForegroundWindow();
More information about the wine-cvs
mailing list