From c3dbe443474f305a474b298fa28280965be0e3c4 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Mon, 24 Oct 2016 10:15:18 +0100 Subject: [PATCH] winemac: Update the keyboard layout data immediately after changing the input source. It would eventually get updated by the keyboard changed event, but only after the message queue was pumped. Signed-off-by: Huw Davies Signed-off-by: Ken Thomases Signed-off-by: Alexandre Julliard --- dlls/winemac.drv/cocoa_app.m | 3 ++- dlls/winemac.drv/keyboard.c | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m index dced704af99..0eaea57d836 100644 --- a/dlls/winemac.drv/cocoa_app.m +++ b/dlls/winemac.drv/cocoa_app.m @@ -2426,7 +2426,8 @@ void macdrv_get_input_source_info(CFDataRef* uchr, CGEventSourceKeyboardType* ke *keyboard_type = [WineApplicationController sharedController].keyboardType; *is_iso = (KBGetLayoutType(*keyboard_type) == kKeyboardISO); - *input_source = TISCopyCurrentKeyboardInputSource(); + if (input_source) + *input_source = TISCopyCurrentKeyboardInputSource(); } }); } diff --git a/dlls/winemac.drv/keyboard.c b/dlls/winemac.drv/keyboard.c index 6680e6b2dc7..3e0ebbf6ec2 100644 --- a/dlls/winemac.drv/keyboard.c +++ b/dlls/winemac.drv/keyboard.c @@ -1186,7 +1186,15 @@ HKL CDECL macdrv_ActivateKeyboardLayout(HKL hkl, UINT flags) if (macdrv_select_input_source(layout->input_source)) { oldHkl = thread_data->active_keyboard_layout; + if (thread_data->keyboard_layout_uchr) + CFRelease(thread_data->keyboard_layout_uchr); + + macdrv_get_input_source_info(&thread_data->keyboard_layout_uchr, &thread_data->keyboard_type, + &thread_data->iso_keyboard, NULL); thread_data->active_keyboard_layout = hkl; + thread_data->dead_key_state = 0; + + macdrv_compute_keyboard_layout(thread_data); } break; } -- 2.11.4.GIT