From: Rémi Bernon rbernon@codeweavers.com
Tracking and activating the global keyboard layout. --- dlls/win32u/input.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 11bb129134c..9415011aee4 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -406,6 +406,7 @@ static const KBDTABLES kbdus_tables =
LONG global_key_state_counter = 0; +static HKL global_layout;
static void kbd_tables_init_vsc2vk( const KBDTABLES *tables, BYTE vsc2vk[0x300] ) @@ -1217,6 +1218,8 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags ) if (!user_driver->pActivateKeyboardLayout( layout, flags )) return 0;
+ InterlockedExchangePointer( (void *)&global_layout, layout ); + old_layout = info->kbd_layout; info->kbd_layout = layout; if (old_layout != layout) @@ -1784,6 +1787,7 @@ BOOL WINAPI release_capture(void) static HWND set_focus_window( HWND hwnd ) { HWND previous = 0, ime_hwnd; + HKL layout; BOOL ret;
SERVER_START_REQ( set_focus_window ) @@ -1811,6 +1815,9 @@ static HWND set_focus_window( HWND hwnd ) { user_driver->pSetFocus(hwnd);
+ if ((layout = InterlockedCompareExchangePointer( (void *)&global_layout, NULL, NULL ))) + NtUserActivateKeyboardLayout( layout, 0 ); + ime_hwnd = get_default_ime_window( hwnd ); if (ime_hwnd) send_message( ime_hwnd, WM_IME_INTERNAL, IME_INTERNAL_ACTIVATE,