Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/driver.c | 2 +- dlls/user32/input.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c index c075a49a350..f683cf25b7e 100644 --- a/dlls/user32/driver.c +++ b/dlls/user32/driver.c @@ -189,7 +189,7 @@ void USER_unload_driver(void)
static HKL CDECL nulldrv_ActivateKeyboardLayout( HKL layout, UINT flags ) { - return 0; + return (HKL)~0; /* use default implementation */ }
static void CDECL nulldrv_Beep(void) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 97be83369d9..ff90bc6f343 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -1310,11 +1310,16 @@ INT WINAPI ToAsciiEx( UINT virtKey, UINT scanCode, const BYTE *lpKeyState, /********************************************************************** * ActivateKeyboardLayout (USER32.@) */ -HKL WINAPI ActivateKeyboardLayout(HKL hLayout, UINT flags) +HKL WINAPI ActivateKeyboardLayout( HKL layout, UINT flags ) { - TRACE_(keyboard)("(%p, %d)\n", hLayout, flags); + HKL old_layout;
- return USER_Driver->pActivateKeyboardLayout(hLayout, flags); + TRACE_(keyboard)( "layout %p, flags %x\n", layout, flags ); + + if ((old_layout = USER_Driver->pActivateKeyboardLayout( layout, flags )) != (HKL)~0) + return old_layout; + + return get_locale_kbd_layout(); }
/**********************************************************************