--- metacity-2.24.0/src/core/display.c.xkb	2008-08-18 05:29:06.000000000 -0700
+++ metacity-2.24.0/src/core/display.c	2008-12-23 21:56:31.000000000 -0800
@@ -2390,4 +2390,8 @@
                 }
 	      break;
+            case XkbNewKeyboardNotify:
+            case XkbMapNotify:
+              meta_display_process_mapping_event (display, event);
+              break;
 	    }
 	}
--- metacity-2.24.0/src/core/keybindings.c.xkb	2008-08-18 05:29:06.000000000 -0700
+++ metacity-2.24.0/src/core/keybindings.c	2008-12-23 22:33:35.000000000 -0800
@@ -903,4 +903,24 @@
                                     XEvent      *event)
 { 
+#ifdef HAVE_XKB
+  if (event->type == display->xkb_base_event_type)
+    {
+      meta_topic (META_DEBUG_KEYBINDINGS,
+                  "XKB mapping changed, will redo keybindings\n");
+
+      reload_keymap (display);
+      reload_modmap (display);
+      
+      rebuild_window_binding_table (display);
+      rebuild_screen_binding_table (display);
+
+      reload_keycodes (display);
+      reload_modifiers (display);
+
+      regrab_screen_bindings (display);
+      regrab_window_bindings (display);
+    }
+  else
+#endif
   if (event->xmapping.request == MappingModifier)
     {
@@ -999,4 +1019,14 @@
   
   meta_prefs_add_listener (bindings_changed_callback, display);
+
+#ifdef HAVE_XKB
+  /* meta_display_init_keys() should have already called XkbQueryExtension() */
+  if (-1 == display->xkb_base_event_type ||
+      False == XkbSelectEvents (display->xdisplay, XkbUseCoreKbd,
+                                XkbNewKeyboardNotifyMask | XkbMapNotifyMask,
+                                XkbNewKeyboardNotifyMask | XkbMapNotifyMask))
+      meta_topic (META_DEBUG_KEYBINDINGS,
+                  "Unable to respond to XKB keyboard mapping changes");
+#endif
 }
 
