diff -Nur gtk+-2.24.17-bak/gdk/quartz/gdkkeys-quartz.c gtk+-2.24.17/gdk/quartz/gdkkeys-quartz.c
--- gtk+-2.24.17-bak/gdk/quartz/gdkkeys-quartz.c	2013-04-05 16:33:22.751903860 +0900
+++ gtk+-2.24.17/gdk/quartz/gdkkeys-quartz.c	2013-04-17 17:16:24.355339392 +0900
@@ -246,7 +246,7 @@
 };
 
 static void
-maybe_update_keymap (void)
+update_keymap (void)
 {
   const void *chr_data = NULL;
 
@@ -485,13 +485,31 @@
     }
 }
 
+static void
+input_sources_changed_notification (CFNotificationCenterRef  center,
+                                    void                    *observer,
+                                    CFStringRef              name,
+                                    const void              *object,
+                                    CFDictionaryRef          userInfo)
+{
+  update_keymap ();
+}
+
 GdkKeymap *
 gdk_keymap_get_for_display (GdkDisplay *display)
 {
   g_return_val_if_fail (display == gdk_display_get_default (), NULL);
 
-  if (default_keymap == NULL)
+  if (default_keymap == NULL) {
     default_keymap = g_object_new (gdk_keymap_get_type (), NULL);
+    update_keymap ();
+    CFNotificationCenterAddObserver (CFNotificationCenterGetDistributedCenter (),
+                                     NULL,
+                                     &input_sources_changed_notification,
+                                     CFSTR ("AppleSelectedInputSourcesChangedNotification"),
+                                     NULL,
+                                     CFNotificationSuspensionBehaviorDeliverImmediately);
+  }
 
   return default_keymap;
 }
@@ -530,8 +548,6 @@
   g_return_val_if_fail (n_keys != NULL, FALSE);
   g_return_val_if_fail (keyval != 0, FALSE);
 
-  maybe_update_keymap ();
-
   *n_keys = 0;
   keys_array = g_array_new (FALSE, FALSE, sizeof (GdkKeymapKey));
 
@@ -570,8 +586,6 @@
   g_return_val_if_fail (keymap == NULL || GDK_IS_KEYMAP (keymap), FALSE);
   g_return_val_if_fail (n_entries != NULL, FALSE);
 
-  maybe_update_keymap ();
-
   *n_entries = 0;
 
   if (hardware_keycode > NUM_KEYCODES)
@@ -689,8 +703,6 @@
   g_return_val_if_fail (keymap == NULL || GDK_IS_KEYMAP (keymap), FALSE);
   g_return_val_if_fail (group >= 0 && group <= 1, FALSE);
   
-  maybe_update_keymap ();
-
   if (keyval)
     *keyval = 0;
   if (effective_group)
