--- gnome-settings-daemon-3.5.1/configure.ac.orig	2012-06-05 16:53:27.905155721 +0900
+++ gnome-settings-daemon-3.5.1/configure.ac	2012-06-05 17:00:26.466234093 +0900
@@ -190,6 +190,7 @@ if test "x$enable_ibus" = "xno" ; then
 else
         have_ibus=no
         PKG_CHECK_MODULES(IBUS, ibus-1.0, have_ibus=yes, have_ibus=no)
+        PKG_CHECK_MODULES(IBUS_XKB, ibus-xkb, have_ibus_xkb=yes, have_ibus_xkb=no)
 
         if test "x$enable_ibus" = "xyes" -a "x$have_ibus" = "xno" ; then
                 AC_MSG_ERROR(IBus support explicity enabled but not available)
@@ -198,10 +199,16 @@ else
         if test "x$have_ibus" = "xyes" ; then
                 AC_DEFINE(HAVE_IBUS, 1, [Defined if IBus support is enabled])
         fi
+
+        if test "x$have_ibus_xkb" = "xyes" ; then
+                AC_DEFINE(HAVE_IBUS_XKB, 1, [Defined if IBus XKB support is enabled])
+        fi
 fi
 AM_CONDITIONAL(HAVE_IBUS, test "x$have_ibus" = "xyes")
 AC_SUBST(IBUS_CFLAGS)
 AC_SUBST(IBUS_LIBS)
+AC_SUBST(IBUS_XKB_CFLAGS)
+AC_SUBST(IBUS_XKB_LIBS)
 
 dnl ---------------------------------------------------------------------------
 dnl - Housekeeping plugin stuff
@@ -546,6 +553,7 @@ echo "
         Session tracking:         ${SESSION_TRACKING}
         LCMS DICT support:        ${have_new_lcms}
         IBus support:             ${have_ibus}
+        IBus XKB support:         ${have_ibus_xkb}
         Libnotify support:        ${have_libnotify}
         PackageKit support:       ${have_packagekit}
         Smartcard support:        ${have_smartcard_support}
--- gnome-settings-daemon-3.5.1/plugins/keyboard/Makefile.am.orig	2012-06-05 16:56:03.317688927 +0900
+++ gnome-settings-daemon-3.5.1/plugins/keyboard/Makefile.am	2012-06-05 16:56:31.570601744 +0900
@@ -35,6 +35,7 @@ libkeyboard_la_CFLAGS = \
 	$(SETTINGS_PLUGIN_CFLAGS)	\
 	$(KEYBOARD_CFLAGS)		\
 	$(IBUS_CFLAGS)			\
+	$(IBUS_XKB_CFLAGS)		\
 	$(AM_CFLAGS)
 
 libkeyboard_la_LDFLAGS = 	\
@@ -47,6 +48,7 @@ libkeyboard_la_LIBADD  =				\
 	$(XF86MISC_LIBS)				\
 	$(KEYBOARD_LIBS)				\
 	$(IBUS_LIBS)					\
+	$(IBUS_XKB_LIBS)				\
 	$(NULL)
 
 noinst_PROGRAMS = test-keyboard
--- gnome-settings-daemon-3.5.1/plugins/keyboard/gsd-keyboard-manager.c.orig	2012-06-05 12:57:41.764346074 +0900
+++ gnome-settings-daemon-3.5.1/plugins/keyboard/gsd-keyboard-manager.c	2012-06-05 18:23:41.100648938 +0900
@@ -48,6 +48,9 @@
 #ifdef HAVE_IBUS
 #include <ibus.h>
 #endif
+#ifdef HAVE_IBUS_XKB
+#include <ibusxkbxml.h>
+#endif
 
 #include "gnome-settings-profile.h"
 #include "gsd-keyboard-manager.h"
@@ -95,6 +98,9 @@ struct GsdKeyboardManagerPrivate
 #ifdef HAVE_IBUS
         GSettings *interface_settings;
         IBusBus   *ibus;
+#ifdef HAVE_IBUS_XKB
+        IBusXKBConfigRegistry *ibus_xkb_registry;
+#endif
         GHashTable *ibus_engines;
 #endif
         gint       xkb_event_base;
@@ -451,9 +457,47 @@ apply_input_sources_settings (GSettings
                         goto exit;
                 }
 #ifdef HAVE_IBUS
+#ifdef HAVE_IBUS_XKB
+                if (priv->ibus_xkb_registry) {
+                    GHashTable *layout_lang = NULL;
+                    GList *list = NULL;
+                    gchar *language = NULL;
+                    gchar *name = NULL;
+
+                    layout_lang = (GHashTable *) ibus_xkb_config_registry_get_layout_lang (
+                        priv->ibus_xkb_registry);
+                    if (layout_lang != NULL) {
+                        gchar *key = NULL;
+                        if (variant != NULL && *variant != '\0') {
+                            key = g_strdup_printf ("%s(%s)", layout, variant);
+                        } else {
+                            key = g_strdup (layout);
+                        }
+                        list = g_hash_table_lookup (layout_lang, key);
+                        g_free(key);
+                        if (list) {
+                            language = g_strdup (list->data);
+                        }
+                    }
+                    name = g_strdup_printf ("xkb:%s:%s:%s",
+                                            layout,
+                                            variant ? variant : "",
+                                            language ? language : "");
+                    if (ibus_bus_set_global_engine (priv->ibus, name)) {
+                        g_settings_set_string (priv->interface_settings,
+                                               KEY_GTK_IM_MODULE,
+                                               GTK_IM_MODULE_IBUS);
+                    } else {
+                        g_warning ("Couldn't set IBus engine '%s'", name);
+                    }
+                    g_free (name);
+                    g_free (language);
+                }
+#else
                 g_settings_set_string (priv->interface_settings,
                                        KEY_GTK_IM_MODULE,
                                        GTK_IM_MODULE_SIMPLE);
+#endif
         } else if (g_str_equal (type, INPUT_SOURCE_TYPE_IBUS)) {
                 IBusEngineDesc *engine_desc = NULL;
 
@@ -481,7 +525,9 @@ apply_input_sources_settings (GSettings
                 goto exit;
         }
 
-        apply_xkb_layout (manager, layout, variant);
+        if (g_strcmp0 (layout, "default") != 0) {
+            apply_xkb_layout (manager, layout, variant);
+        }
 
  exit:
         g_variant_unref (sources);
@@ -643,6 +689,9 @@ start_keyboard_idle_cb (GsdKeyboardManag
         if (manager->priv->ibus)
                 fetch_ibus_engines (manager);
 #endif
+#ifdef HAVE_IBUS_XKB
+        manager->priv->ibus_xkb_registry = ibus_xkb_config_registry_new ();
+#endif
 
         /* apply current settings before we install the callback */
         apply_settings (manager->priv->settings, NULL, manager);
