Quartz: Fix keyboard layout notification

Register for notifications before initializing keymaps
This commit is contained in:
Luca Bacci 2021-11-24 16:20:02 +01:00
parent c2e6fcc92d
commit 78a0cdde83
No known key found for this signature in database
GPG Key ID: 8E3C8D989C98883D

View File

@ -812,13 +812,13 @@ input_sources_changed_notification (CFNotificationCenterRef center,
static void static void
gdk_quartz_keymap_init (GdkQuartzKeymap *keymap) gdk_quartz_keymap_init (GdkQuartzKeymap *keymap)
{ {
update_keymap ();
CFNotificationCenterAddObserver (CFNotificationCenterGetDistributedCenter (), CFNotificationCenterAddObserver (CFNotificationCenterGetDistributedCenter (),
keymap, keymap,
input_sources_changed_notification, input_sources_changed_notification,
CFSTR ("AppleSelectedInputSourcesChangedNotification"), CFSTR ("AppleSelectedInputSourcesChangedNotification"),
NULL, NULL,
CFNotificationSuspensionBehaviorDeliverImmediately); CFNotificationSuspensionBehaviorDeliverImmediately);
update_keymap ();
} }
static void static void