winemac: Update the keyboard layout data immediately after changing the input source.
Huw Davies
huw at codeweavers.com
Mon Oct 24 04:15:18 CDT 2016
It would eventually get updated by the keyboard changed event, but
only after the message queue was pumped.
Signed-off-by: Huw Davies <huw at codeweavers.com>
---
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 dced704..0eaea57 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 6680e6b..3e0ebbf 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.8.2
More information about the wine-patches
mailing list