mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 01:03:38 +00:00
imm32: Update existing input contexts on layout change.
This commit is contained in:
parent
43e22eaa76
commit
0ddad3564f
|
@ -3152,6 +3152,11 @@ static LRESULT ime_internal_msg( WPARAM wparam, LPARAM lparam)
|
|||
ImmSetActiveContext(hwnd, himc, wparam == IME_INTERNAL_ACTIVATE);
|
||||
ImmReleaseContext(hwnd, himc);
|
||||
break;
|
||||
case IME_INTERNAL_HKL_ACTIVATE:
|
||||
ImmEnumInputContext( 0, enum_activate_layout, 0 );
|
||||
break;
|
||||
case IME_INTERNAL_HKL_DEACTIVATE:
|
||||
break;
|
||||
default:
|
||||
FIXME("wparam = %Ix\n", wparam);
|
||||
break;
|
||||
|
|
|
@ -4013,12 +4013,12 @@ static void test_ImmActivateLayout(void)
|
|||
{
|
||||
.hkl = expect_ime, .himc = default_himc,
|
||||
.func = IME_SELECT, .select = 1,
|
||||
.todo = TRUE, .flaky_himc = TRUE,
|
||||
.flaky_himc = TRUE,
|
||||
},
|
||||
{
|
||||
.hkl = expect_ime, .himc = 0/*himc*/,
|
||||
.func = IME_SELECT, .select = 1,
|
||||
.todo = TRUE, .flaky_himc = TRUE,
|
||||
.flaky_himc = TRUE,
|
||||
},
|
||||
{
|
||||
.hkl = expect_ime, .himc = default_himc,
|
||||
|
@ -4067,12 +4067,12 @@ static void test_ImmActivateLayout(void)
|
|||
{
|
||||
.hkl = default_hkl, .himc = default_himc,
|
||||
.func = IME_SELECT, .select = 0,
|
||||
.todo = TRUE, .flaky_himc = TRUE,
|
||||
.flaky_himc = TRUE,
|
||||
},
|
||||
{
|
||||
.hkl = default_hkl, .himc = 0/*himc*/,
|
||||
.func = IME_SELECT, .select = 0,
|
||||
.todo = TRUE, .flaky_himc = TRUE,
|
||||
.flaky_himc = TRUE,
|
||||
},
|
||||
{0},
|
||||
};
|
||||
|
@ -4149,7 +4149,6 @@ static void test_ImmActivateLayout(void)
|
|||
|
||||
SET_EXPECT( ImeInquire );
|
||||
ok_eq( old_hkl, ActivateKeyboardLayout( hkl, 0 ), HKL, "%p" );
|
||||
todo_wine
|
||||
CHECK_CALLED( ImeInquire );
|
||||
activate_with_window_seq[1].himc = himc;
|
||||
ok_seq( activate_with_window_seq );
|
||||
|
@ -4164,7 +4163,9 @@ static void test_ImmActivateLayout(void)
|
|||
memset( ime_calls, 0, sizeof(ime_calls) );
|
||||
ime_call_count = 0;
|
||||
|
||||
todo_ImeDestroy = TRUE; /* Wine doesn't leak the IME */
|
||||
ok_eq( hkl, ActivateKeyboardLayout( old_hkl, 0 ), HKL, "%p" );
|
||||
todo_ImeDestroy = FALSE;
|
||||
deactivate_with_window_seq[1].himc = himc;
|
||||
deactivate_with_window_seq[5].himc = himc;
|
||||
ok_seq( deactivate_with_window_seq );
|
||||
|
@ -4175,7 +4176,9 @@ static void test_ImmActivateLayout(void)
|
|||
ok_seq( empty_sequence );
|
||||
|
||||
|
||||
todo_ImeInquire = TRUE;
|
||||
ok_eq( old_hkl, ActivateKeyboardLayout( hkl, 0 ), HKL, "%p" );
|
||||
todo_ImeInquire = FALSE;
|
||||
ok_eq( hkl, GetKeyboardLayout( 0 ), HKL, "%p" );
|
||||
|
||||
ok_ret( 1, EnumThreadWindows( GetCurrentThreadId(), enum_thread_ime_windows, (LPARAM)&ime_windows ) );
|
||||
|
@ -4183,7 +4186,9 @@ static void test_ImmActivateLayout(void)
|
|||
todo_wine ok( !!ime_windows.ime_ui_hwnd, "missing IME UI window\n" );
|
||||
todo_wine ok_ret( (UINT_PTR)ime_windows.ime_hwnd, (UINT_PTR)GetParent( ime_windows.ime_ui_hwnd ) );
|
||||
|
||||
todo_ImeDestroy = TRUE; /* Wine doesn't leak the IME */
|
||||
ok_eq( hkl, ActivateKeyboardLayout( old_hkl, 0 ), HKL, "%p" );
|
||||
todo_ImeDestroy = FALSE;
|
||||
ok_eq( old_hkl, GetKeyboardLayout( 0 ), HKL, "%p" );
|
||||
|
||||
|
||||
|
|
|
@ -1219,12 +1219,14 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags )
|
|||
return 0;
|
||||
|
||||
old_layout = info->kbd_layout;
|
||||
info->kbd_layout = layout;
|
||||
if (old_layout != layout)
|
||||
{
|
||||
HWND ime_hwnd = get_default_ime_window( 0 );
|
||||
const NLS_LOCALE_DATA *data;
|
||||
CHARSETINFO cs = {0};
|
||||
|
||||
if (ime_hwnd) send_message( ime_hwnd, WM_IME_INTERNAL, IME_INTERNAL_HKL_DEACTIVATE, HandleToUlong(old_layout) );
|
||||
|
||||
if (HIWORD(layout) & 0x8000)
|
||||
FIXME( "Aliased keyboard layout not yet implemented\n" );
|
||||
else if (!(data = get_locale_data( HIWORD(layout) )))
|
||||
|
@ -1232,7 +1234,11 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags )
|
|||
else
|
||||
translate_charset_info( ULongToPtr(data->idefaultansicodepage), &cs, TCI_SRCCODEPAGE );
|
||||
|
||||
info->kbd_layout = layout;
|
||||
info->kbd_layout_id = 0;
|
||||
|
||||
if (ime_hwnd) send_message( ime_hwnd, WM_IME_INTERNAL, IME_INTERNAL_HKL_ACTIVATE, HandleToUlong(layout) );
|
||||
|
||||
if ((focus = get_focus()) && get_window_thread( focus, NULL ) == GetCurrentThreadId())
|
||||
send_message( focus, WM_INPUTLANGCHANGE, cs.ciCharset, (LPARAM)layout );
|
||||
}
|
||||
|
|
|
@ -487,6 +487,8 @@ enum wine_internal_message
|
|||
#define WM_IME_INTERNAL 0x287
|
||||
#define IME_INTERNAL_ACTIVATE 0x17
|
||||
#define IME_INTERNAL_DEACTIVATE 0x18
|
||||
#define IME_INTERNAL_HKL_ACTIVATE 0x19
|
||||
#define IME_INTERNAL_HKL_DEACTIVATE 0x20
|
||||
|
||||
#define WM_SYSTIMER 0x0118
|
||||
|
||||
|
|
Loading…
Reference in a new issue