imm32: Only call ImmSetActiveContext for focused window in ImmAssociateContext.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
374ad33904
commit
f84d88d44a
|
@ -771,7 +771,7 @@ HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC)
|
|||
else
|
||||
SetPropW(hWnd, szwWineIMCProperty, hIMC);
|
||||
|
||||
if (GetActiveWindow() == hWnd)
|
||||
if (GetFocus() == hWnd)
|
||||
{
|
||||
ImmSetActiveContext(hWnd, old, FALSE);
|
||||
ImmSetActiveContext(hWnd, hIMC, TRUE);
|
||||
|
|
|
@ -207,7 +207,7 @@ static void msg_spy_cleanup(void) {
|
|||
static const char wndcls[] = "winetest_imm32_wndcls";
|
||||
static enum { PHASE_UNKNOWN, FIRST_WINDOW, SECOND_WINDOW,
|
||||
CREATE_CANCEL, NCCREATE_CANCEL, IME_DISABLED } test_phase;
|
||||
static HWND hwnd;
|
||||
static HWND hwnd, child;
|
||||
|
||||
static HWND get_ime_window(void);
|
||||
|
||||
|
@ -326,6 +326,10 @@ static BOOL init(void) {
|
|||
if (!hwnd)
|
||||
return FALSE;
|
||||
|
||||
child = CreateWindowA("edit", "edit", WS_CHILD | WS_VISIBLE, 0, 0, 50, 50, hwnd, 0, 0, 0);
|
||||
if (!child)
|
||||
return FALSE;
|
||||
|
||||
ShowWindow(hwnd, SW_SHOWNORMAL);
|
||||
UpdateWindow(hwnd);
|
||||
|
||||
|
@ -726,9 +730,21 @@ static void test_ImmAssociateContextEx(void)
|
|||
SET_EXPECT(WM_IME_SETCONTEXT_ACTIVATE);
|
||||
DestroyWindow(focus);
|
||||
CHECK_CALLED(WM_IME_SETCONTEXT_ACTIVATE);
|
||||
SetFocus(hwnd);
|
||||
|
||||
SET_EXPECT(WM_IME_SETCONTEXT_DEACTIVATE);
|
||||
SetFocus(child);
|
||||
CHECK_CALLED(WM_IME_SETCONTEXT_DEACTIVATE);
|
||||
rc = pImmAssociateContextEx(hwnd, newimc, 0);
|
||||
ok(rc, "ImmAssociateContextEx failed\n");
|
||||
SET_EXPECT(WM_IME_SETCONTEXT_ACTIVATE);
|
||||
SetFocus(hwnd);
|
||||
CHECK_CALLED(WM_IME_SETCONTEXT_ACTIVATE);
|
||||
|
||||
SET_EXPECT(WM_IME_SETCONTEXT_DEACTIVATE);
|
||||
SET_EXPECT(WM_IME_SETCONTEXT_ACTIVATE);
|
||||
rc = pImmAssociateContextEx(hwnd, NULL, IACE_DEFAULT);
|
||||
CHECK_CALLED(WM_IME_SETCONTEXT_DEACTIVATE);
|
||||
CHECK_CALLED(WM_IME_SETCONTEXT_ACTIVATE);
|
||||
ok(rc, "ImmAssociateContextEx failed\n");
|
||||
|
||||
SET_ENABLE(WM_IME_SETCONTEXT_ACTIVATE, FALSE);
|
||||
|
|
Loading…
Reference in New Issue