public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/ibus] autotool: Bumped to 1.5.8
@ 2026-05-31  2:06 Takao Fujiwara
  0 siblings, 0 replies; only message in thread
From: Takao Fujiwara @ 2026-05-31  2:06 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/ibus
Branch : autotool
Commit : 6ad2e121a85daf7f8cf8e619b7b468b6d3da6eea
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date   : 2014-07-24T15:16:16+09:00
Stats  : +28/-6893 in 10 file(s)
URL    : https://src.fedoraproject.org/rpms/ibus/c/6ad2e121a85daf7f8cf8e619b7b468b6d3da6eea?branch=autotool

Log:
Bumped to 1.5.8

---
diff --git a/.gitignore b/.gitignore
index 9bc24c6..96fee91 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,3 +39,4 @@ ibus-1.3.6.tar.gz
 /ibus-1.5.5.tar.gz
 /ibus-1.5.6.tar.gz
 /ibus-1.5.7.tar.gz
+/ibus-1.5.8.tar.gz

diff --git a/ibus-530711-preload-sys.patch b/ibus-530711-preload-sys.patch
deleted file mode 100644
index d1869c4..0000000
--- a/ibus-530711-preload-sys.patch
+++ /dev/null
@@ -1,354 +0,0 @@
-From 91f6d9f3d0fc854711c2ba151c0dc5105a0a9152 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 14 Jul 2014 16:20:21 +0900
-Subject: [PATCH] Reload preload engines until users customize the list.
-
-The idea is, if users don't customize the preload_engines with ibus-setup,
-users would prefer to load the system default engines again by login.
-The gsettings value 'preload-engine-mode' is
-IBUS_PRELOAD_ENGINE_MODE_USER by default but set
-IBUS_PRELOAD_ENGINE_MODE_LANG_RELATIVE for the initial login.
-If 'preload-engine-mode' is IBUS_PRELOAD_ENGINE_MODE_LANG_RELATIVE,
-ibus-daemon loads the system preload engines by langs.
-If 'preload-engine-mode' is IBUS_PRELOAD_ENGINE_MODE_USER,
-ibus-daemon do not update the gsettings value 'preload-engines'
-On the other hand, if users enable the customized engine checkbutton
-on ibus-setup, ibus-setup sets 'preload-engine-mode' as
-IBUS_PRELOAD_ENGINE_MODE_USER and users can customize the value
-'preload-engines'.
----
- data/ibus.schemas.in | 24 ++++++++++++++
- setup/main.py        | 72 ++++++++++++++++++++++++++++++++++++----
- setup/setup.ui       | 22 +++++++++++--
- src/ibustypes.h      | 10 ++++++
- ui/gtk3/panel.vala   | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++
- 5 files changed, 212 insertions(+), 9 deletions(-)
-
-diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in
-index 1e4776b..9ee0b1a 100644
---- a/data/ibus.schemas.in
-+++ b/data/ibus.schemas.in
-@@ -2,6 +2,30 @@
- <gconfschemafile>
-   <schemalist>
-     <schema>
-+      <key>/schemas/desktop/ibus/general/preload_engine_mode</key>
-+      <applyto>/desktop/ibus/general/preload_engine_mode</applyto>
-+      <owner>ibus</owner>
-+      <type>int</type>
-+      <default>0</default>
-+      <locale name="C">
-+        <short>Preload engine mode</short>
-+            <long>Preload engines are loaded with this mode.
-+                  0 = user customized engines.
-+                  1 = language related engines.</long>
-+      </locale>
-+    </schema>
-+    <schema>
-+      <key>/schemas/desktop/ibus/general/preload_engines_inited</key>
-+      <applyto>/desktop/ibus/general/preload_engines_inited</applyto>
-+      <owner>ibus</owner>
-+      <type>bool</type>
-+      <default>false</default>
-+      <locale name="C">
-+        <short>The key preload_engines is initialized</short>
-+            <long>The key preload_engines is initialized</long>
-+      </locale>
-+    </schema>
-+    <schema>
-       <key>/schemas/desktop/ibus/general/preload_engines</key>
-       <applyto>/desktop/ibus/general/preload_engines</applyto>
-       <owner>ibus</owner>
-diff --git a/setup/main.py b/setup/main.py
-index dee7be4..a991438 100644
---- a/setup/main.py
-+++ b/setup/main.py
-@@ -190,16 +190,30 @@ class Setup(object):
-                                     'active',
-                                     Gio.SettingsBindFlags.DEFAULT)
- 
-+        # set preload mode
-+        preload_engine_mode = \
-+                self.__settings_general.get_int('preload-engine-mode')
-+        button = self.__builder.get_object("checkbutton_preload_engine_mode")
-+        hbox = self.__builder.get_object("hbox_customize_active_input_methods")
-+        if preload_engine_mode == IBus.PreloadEngineMode.USER:
-+            button.set_active(True)
-+            hbox.set_sensitive(True)
-+        else:
-+            button.set_active(False)
-+            hbox.set_sensitive(False)
-+        button.connect('toggled',
-+                       self.__checkbutton_preload_engine_mode_toggled_cb)
-+
-+        self.__settings_general.connect('changed::preload-engines',
-+                self.__settings_general_preload_engines_cb)
-+
-         # init engine page
-         self.__engines = self.__bus.list_engines()
-         self.__combobox = self.__builder.get_object("combobox_engines")
-         self.__combobox.set_engines(self.__engines)
- 
--        tmp_dict = {}
--        for e in self.__engines:
--            tmp_dict[e.get_name()] = e
-         engine_names = self.__settings_general.get_strv('preload-engines')
--        engines = [tmp_dict[name] for name in engine_names if name in tmp_dict]
-+        engines = self.__get_engine_descs_from_names(engine_names)
- 
-         self.__treeview = self.__builder.get_object("treeview_engines")
-         self.__treeview.set_engines(engines)
-@@ -249,8 +263,9 @@ class Setup(object):
-     def __combobox_notify_active_engine_cb(self, combobox, property):
-         engine = self.__combobox.get_active_engine()
-         button = self.__builder.get_object("button_engine_add")
--        button.set_sensitive(
--                engine != None and engine not in self.__treeview.get_engines())
-+        button.set_sensitive(engine != None and \
-+                engine.get_name() not in [e.get_name() for e \
-+                                          in self.__treeview.get_engines()])
- 
-     def __get_engine_setup_exec_args(self, engine):
-         args = []
-@@ -270,6 +285,13 @@ class Setup(object):
-             args.append(path.basename(setup_path))
-         return args
- 
-+    def __get_engine_descs_from_names(self, engine_names):
-+        tmp_dict = {}
-+        for e in self.__engines:
-+            tmp_dict[e.get_name()] = e
-+        engines = [tmp_dict[name] for name in engine_names if name in tmp_dict]
-+        return engines
-+
-     def __treeview_notify_cb(self, treeview, prop):
-         if prop.name not in ("active-engine", "engines"):
-             return
-@@ -321,6 +343,44 @@ class Setup(object):
-             del self.__engine_setup_exec_list[name]
-         self.__engine_setup_exec_list[name] = os.spawnl(os.P_NOWAIT, *args)
- 
-+    def __checkbutton_preload_engine_mode_toggled_cb(self, button):
-+        if button.get_active():
-+            self.__settings_general.set_int('preload-engine-mode',
-+                                            IBus.PreloadEngineMode.USER)
-+            self.__builder.get_object(
-+                    "hbox_customize_active_input_methods").set_sensitive(True)
-+            self.__treeview.notify('engines')
-+        else:
-+            message = _("The list of your saved input methods will be " \
-+                        "cleared immediately and the list will be " \
-+                        "configured by the login language every time. " \
-+                        "Do you agree with this?")
-+            dlg = Gtk.MessageDialog(message_type = Gtk.MessageType.QUESTION,
-+                    transient_for = self.__window,
-+                    buttons = Gtk.ButtonsType.YES_NO,
-+                    text = message)
-+            id = dlg.run()
-+            dlg.destroy()
-+            self.__flush_gtk_events()
-+            if id != Gtk.ResponseType.YES:
-+                button.set_active(True)
-+                return
-+            self.__settings_general.set_int(
-+                    'preload-engine-mode',
-+                    IBus.PreloadEngineMode.LANG_RELATIVE)
-+            self.__builder.get_object(
-+                    "hbox_customize_active_input_methods").set_sensitive(False)
-+
-+    def __settings_general_preload_engines_cb(self, settings, key):
-+        engine_names = self.__settings_general.get_strv('preload-engines')
-+        engines = self.__get_engine_descs_from_names(engine_names)
-+        current_engines = self.__treeview.get_engines()
-+        engines_csv = str.join(',', [e.get_name() for e in engines])
-+        current_engines_csv = \
-+                str.join(',', [e.get_name() for e in current_engines])
-+        if engines_csv != current_engines_csv:
-+            self.__treeview.set_engines(engines)
-+
-     def __init_bus(self):
-         self.__bus = IBus.Bus()
-         if self.__bus.is_connected():
-diff --git a/setup/setup.ui b/setup/setup.ui
-index 5ffbe47..7c60b72 100644
---- a/setup/setup.ui
-+++ b/setup/setup.ui
-@@ -677,7 +677,23 @@
-                     <property name="visible">True</property>
-                     <property name="can_focus">False</property>
-                     <child>
--                      <object class="GtkBox" id="hbox1">
-+                      <object class="GtkCheckButton" id="checkbutton_preload_engine_mode">
-+                        <property name="visible">True</property>
-+                        <property name="label" translatable="yes">Customize active input _methods</property>
-+                        <property name="use_underline">True</property>
-+                        <property name="can_focus">True</property>
-+                        <property name="receives_default">False</property>
-+                        <property name="tooltip_text" translatable="yes">Customize active input methods</property>
-+                        <property name="draw_indicator">True</property>
-+                      </object>
-+                      <packing>
-+                        <property name="expand">False</property>
-+                        <property name="fill">True</property>
-+                        <property name="position">0</property>
-+                      </packing>
-+                    </child>
-+                    <child>
-+                      <object class="GtkBox" id="hbox_customize_active_input_methods">
-                         <property name="orientation">horizontal</property>
-                         <property name="visible">True</property>
-                         <property name="can_focus">False</property>
-@@ -869,7 +885,7 @@
-                       <packing>
-                         <property name="expand">True</property>
-                         <property name="fill">True</property>
--                        <property name="position">0</property>
-+                        <property name="position">1</property>
-                       </packing>
-                     </child>
-                     <child>
-@@ -917,7 +933,7 @@
-                       <packing>
-                         <property name="expand">False</property>
-                         <property name="fill">True</property>
--                        <property name="position">1</property>
-+                        <property name="position">2</property>
-                       </packing>
-                     </child>
-                   </object>
-diff --git a/src/ibustypes.h b/src/ibustypes.h
-index 86fc2cc..cb9eb22 100644
---- a/src/ibustypes.h
-+++ b/src/ibustypes.h
-@@ -206,6 +206,16 @@ typedef enum {
- } IBusError;
- 
- /**
-+ * IBusPreloadEngineMode:
-+ * @IBUS_PRELOAD_ENGINE_MODE_USER: user custimized engines
-+ * @IBUS_PRELOAD_ENGINE_MODE_LANG_RELATIVE: language related engines.
-+ */
-+typedef enum {
-+    IBUS_PRELOAD_ENGINE_MODE_USER          = 0,
-+    IBUS_PRELOAD_ENGINE_MODE_LANG_RELATIVE = 1,
-+} IBusPreloadEngineMode;
-+
-+/**
-  * IBusRectangle:
-  * @x: x coordinate.
-  * @y: y coordinate.
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index 7a15049..e6c128a 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -141,6 +141,10 @@ class Panel : IBus.PanelService {
-                                null);
-         });
- 
-+        m_settings_general.changed["preload-engine-mode"].connect((key) => {
-+                update_im_engines();
-+        });
-+
-         m_settings_general.changed["switcher-delay-time"].connect((key) => {
-                 set_switcher_delay_time();
-         });
-@@ -569,7 +573,96 @@ class Panel : IBus.PanelService {
-             init_gkbd();
-         }
- 
-+        string[] preload_engines =
-+                m_settings_general.get_strv("preload-engines");
-+
-+        bool preload_engines_inited =
-+                m_settings_general.get_boolean("preload-engines-inited");
-+
-+        // Set preload_engines_inited = true for back compatibility
-+        if (preload_engines.length != 0 && !preload_engines_inited) {
-+                preload_engines_inited = true;
-+                m_settings_general.set_boolean("preload-engines-inited", true);
-+        }
-+
-         update_xkb_engines();
-+
-+        // Before update preload_engine_mode, update_xkb_engines() is called
-+        // because "preload-engine-mode" signal calls update_im_engines().
-+        if (!preload_engines_inited)
-+            m_settings_general.set_int("preload-engine-mode",
-+                                       IBus.PreloadEngineMode.LANG_RELATIVE);
-+
-+        update_im_engines();
-+
-+        if (!preload_engines_inited)
-+            m_settings_general.set_boolean("preload-engines-inited", true);
-+    }
-+
-+    private bool set_lang_relative_preload_engines() {
-+        string locale = Intl.setlocale(LocaleCategory.CTYPE, null);
-+
-+        if (locale == null)
-+            locale = "C";
-+
-+        string lang = locale.split(".")[0];
-+        GLib.List<IBus.EngineDesc> engines = m_bus.list_engines();
-+        string[] im_engines = {};
-+
-+        for (unowned GLib.List<IBus.EngineDesc> p = engines;
-+             p != null;
-+             p = p.next) {
-+            unowned IBus.EngineDesc engine = p.data;
-+            if (engine.get_language() == lang && engine.get_rank() > 0)
-+                im_engines += engine.get_name();
-+        }
-+
-+        lang = lang.split("_")[0];
-+        if (im_engines.length == 0) {
-+            for (unowned GLib.List<IBus.EngineDesc> p = engines;
-+                 p != null;
-+                 p = p.next) {
-+                unowned IBus.EngineDesc engine = p.data;
-+                if (engine.get_language() == lang && engine.get_rank() > 0)
-+                    im_engines += engine.get_name();
-+            }
-+        }
-+
-+        if (im_engines.length == 0)
-+            return false;
-+
-+        string[] orig_preload_engines =
-+                m_settings_general.get_strv("preload-engines");
-+        string[] preload_engines = {};
-+
-+        // clear input method engines
-+        foreach (string name in orig_preload_engines) {
-+            if (name.ascii_ncasecmp("xkb:", 4) != 0)
-+                continue;
-+
-+            preload_engines += name;
-+        }
-+
-+        foreach (string name in im_engines) {
-+            if (!(name in preload_engines))
-+                preload_engines += name;
-+        }
-+
-+        if (string.joinv(",", orig_preload_engines) !=
-+            string.joinv(",", preload_engines))
-+            m_settings_general.set_strv("preload-engines", preload_engines);
-+
-+        return true;
-+    }
-+
-+    private void update_im_engines() {
-+        int preload_engine_mode =
-+                m_settings_general.get_int("preload-engine-mode");
-+
-+        if (preload_engine_mode == IBus.PreloadEngineMode.USER)
-+            return;
-+
-+        set_lang_relative_preload_engines();
-     }
- 
-     private void update_xkb_engines() {
--- 
-1.8.5.3
-

diff --git a/ibus-541492-xkb.patch b/ibus-541492-xkb.patch
deleted file mode 100644
index 016ca6e..0000000
--- a/ibus-541492-xkb.patch
+++ /dev/null
@@ -1,2001 +0,0 @@
-From bce8b85886075fbdbf28bd5795be8bd41f3a984e Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 13 Mar 2014 15:49:11 +0900
-Subject: [PATCH] Add libgnomekbd and load preload engines.
-
----
- bindings/vala/Gkbd-3.0.metadata |   1 +
- bindings/vala/Makefile.am       |  19 +-
- bindings/vala/Xkl-1.0.metadata  |   3 +
- bindings/vala/gkbd.deps         |   3 +
- bus/ibusimpl.c                  |  12 +-
- configure.ac                    |  40 ++++
- data/ibus.schemas.in            |  59 +++++
- ibus-1.0.pc.in                  |   1 +
- ibus.spec.in                    |  12 ++
- src/Makefile.am                 |   3 +
- src/ibus.h                      |   1 +
- src/ibusxkbxml.c                | 466 ++++++++++++++++++++++++++++++++++++++++
- src/ibusxkbxml.h                | 187 ++++++++++++++++
- ui/gtk3/Makefile.am             |  36 ++++
- ui/gtk3/gkbdlayout.vala.false   |  63 ++++++
- ui/gtk3/gkbdlayout.vala.true    | 108 ++++++++++
- ui/gtk3/panel.vala              | 230 +++++++++++++++++++-
- ui/gtk3/xkblayout.vala          | 429 ++++++++++++++++++++++++++++++++++++
- 18 files changed, 1668 insertions(+), 5 deletions(-)
- create mode 100644 bindings/vala/Gkbd-3.0.metadata
- create mode 100644 bindings/vala/Xkl-1.0.metadata
- create mode 100644 bindings/vala/gkbd.deps
- create mode 100644 src/ibusxkbxml.c
- create mode 100644 src/ibusxkbxml.h
- create mode 100644 ui/gtk3/gkbdlayout.vala.false
- create mode 100644 ui/gtk3/gkbdlayout.vala.true
- create mode 100644 ui/gtk3/xkblayout.vala
-
-diff --git a/bindings/vala/Gkbd-3.0.metadata b/bindings/vala/Gkbd-3.0.metadata
-new file mode 100644
-index 0000000..661e6fd
---- /dev/null
-+++ b/bindings/vala/Gkbd-3.0.metadata
-@@ -0,0 +1 @@
-+Configuration cheader_filename="libgnomekbd/gkbd-configuration.h"
-diff --git a/bindings/vala/Makefile.am b/bindings/vala/Makefile.am
-index 29cc1eb..1d28501 100644
---- a/bindings/vala/Makefile.am
-+++ b/bindings/vala/Makefile.am
-@@ -28,8 +28,6 @@ vapi_deps = \
- 	$(top_builddir)/src/IBus-1.0.gir \
- 	$(NULL)
- 
--ibus-1.0.vapi: $(vapi_deps)
--
- VAPIGEN_VAPIS = ibus-1.0.vapi
- 
- ibus_1_0_vapi_DEPS = gio-2.0
-@@ -39,19 +37,34 @@ ibus_1_0_vapi_FILES = \
- 	$(srcdir)/IBus-1.0-custom.vala \
- 	$(NULL)
- 
-+if ENABLE_LIBGNOMEKBD
-+ibus-1.0.vapi: $(vapi_deps) gkbd.vapi
-+
-+VAPIGEN_VAPIS += gkbd.vapi
-+
-+gkbd_vapi_DEPS = gtk+-3.0 glib-2.0 gmodule-2.0
-+gkbd_vapi_METADATADIRS = $(srcdir)
-+gkbd_vapi_FILES = /usr/share/gir-1.0/Gkbd-3.0.gir
-+else
-+ibus-1.0.vapi: $(vapi_deps)
-+endif
-+
- vapidir = $(datadir)/vala/vapi
--vapi_DATA = $(VAPIGEN_VAPIS) $(VAPIGEN_VAPIS:.vapi=.deps)
-+vapi_DATA = ibus-1.0.vapi ibus-1.0.deps
- 
- MAINTAINERCLEANFILES = $(VAPIGEN_VAPIS)
- 
- EXTRA_DIST = \
- 	$(VAPIGEN_VAPIS) \
-+	Gkbd-3.0.metadata \
-+	gkbd.deps \
- 	IBus-1.0.metadata \
- 	IBus-1.0-custom.vala \
- 	ibus-1.0.deps \
- 	ibus-private.vapi \
- 	config.vapi \
- 	xi.vapi \
-+	Xkl-1.0.metadata \
- 	$(NULL)
- 
- -include $(top_srcdir)/git.mk
-diff --git a/bindings/vala/Xkl-1.0.metadata b/bindings/vala/Xkl-1.0.metadata
-new file mode 100644
-index 0000000..4961d0c
---- /dev/null
-+++ b/bindings/vala/Xkl-1.0.metadata
-@@ -0,0 +1,3 @@
-+Xkl cheader_filename="libxklavier/xklavier.h"
-+Engine
-+    .filter_events.evt ref type="X.Event"
-diff --git a/bindings/vala/gkbd.deps b/bindings/vala/gkbd.deps
-new file mode 100644
-index 0000000..172632c
---- /dev/null
-+++ b/bindings/vala/gkbd.deps
-@@ -0,0 +1,3 @@
-+gtk+-3.0
-+glib-2.0
-+gmodule-2.0
-diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
-index eec6da3..f84c034 100644
---- a/bus/ibusimpl.c
-+++ b/bus/ibusimpl.c
-@@ -1135,7 +1135,17 @@ _ibus_get_engines_by_names (BusIBusImpl           *ibus,
-     g_variant_builder_init (&builder, G_VARIANT_TYPE ("av"));
-     while (names[i] != NULL) {
-         IBusEngineDesc *desc = (IBusEngineDesc *) g_hash_table_lookup (
--                ibus->engine_table, names[i++]);
-+                ibus->engine_table, names[i]);
-+
-+        /* preload engines return user XKB so if the engine does not
-+         * exist in simple.xml, fall back to 'us' layout. */
-+        if (desc == NULL && g_str_has_prefix (names[i], "xkb:")) {
-+            desc = (IBusEngineDesc *) g_hash_table_lookup (
-+                    ibus->engine_table, "xkb:us::eng");
-+        }
-+
-+        i++;
-+
-         if (desc == NULL)
-             continue;
-         g_variant_builder_add (
-diff --git a/configure.ac b/configure.ac
-index 9a502ec..3ec629d 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -261,6 +261,45 @@ else
-     enable_wayland="no (disabled, use --enable-wayland to enable)"
- fi
- 
-+# Option for XKB command.
-+PKG_CHECK_MODULES(XKB,
-+    [xkbfile],,
-+    [XKB_LIBS="-lxkbfile"]
-+)
-+
-+# --enable-libgnomekbd option.
-+AC_ARG_ENABLE(libgnomekbd,
-+    AS_HELP_STRING([--enable-libgnomekbd],
-+                   [Use libgnomekbd to handle the keymaps]),
-+    [enable_libgnomekbd=$enableval],
-+    [enable_libgnomekbd=no]
-+)
-+AM_CONDITIONAL([ENABLE_LIBGNOMEKBD], [test x"$enable_libgnomekbd" = x"yes"])
-+if test x"$enable_libgnomekbd" = x"yes"; then
-+    # check for libgnomekbd
-+    PKG_CHECK_MODULES(LIBGNOMEKBDUI, [
-+        libgnomekbdui
-+    ])
-+    PKG_CHECK_MODULES(ATK, [
-+        atk
-+    ])
-+    HAVE_IBUS_GKBD=true
-+else
-+    enable_libgnomekbd="no (disabled, use --enable-libgnomekbd to enable)"
-+    HAVE_IBUS_GKBD=false
-+fi
-+AC_SUBST(HAVE_IBUS_GKBD)
-+
-+# Define XKB rules file
-+AC_ARG_WITH(xkb-rules-xml,
-+    AS_HELP_STRING([--with-xkb-rules-xml[=$DIR/evdev.xml]],
-+        [Set evdev.xml file path (default: /usr/share/X11/xkb/rules/evdev.xml)]),
-+    XKB_RULES_XML_FILE=$with_xkb_rules_xml,
-+    XKB_RULES_XML_FILE="/usr/share/X11/xkb/rules/evdev.xml"
-+)
-+AC_DEFINE_UNQUOTED(XKB_RULES_XML_FILE, "$XKB_RULES_XML_FILE",
-+    [Define file path of evdev.xml])
-+
- # GObject introspection
- GOBJECT_INTROSPECTION_CHECK([0.6.8])
- 
-@@ -640,6 +679,7 @@ Build options:
-   Panel icon                "$IBUS_ICON_KEYBOARD"
-   Enable surrounding-text   $enable_surrounding_text
-   Enable libnotify          $enable_libnotify
-+  Build libgnomebkd         $enable_libgnomekbd
-   Run test cases            $enable_tests
- ])
- 
-diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in
-index 2f76ce3..caec315 100644
---- a/data/ibus.schemas.in
-+++ b/data/ibus.schemas.in
-@@ -56,6 +56,52 @@
-       </locale>
-     </schema>
-     <schema>
-+      <key>/schemas/desktop/ibus/general/use_xmodmap</key>
-+      <applyto>/desktop/ibus/general/use_xmodmap</applyto>
-+      <owner>ibus</owner>
-+      <type>bool</type>
-+      <default>true</default>
-+      <locale name="C">
-+        <short>Use xmodmap</short>
-+           <long>Run xmodmap if .xmodmap/.Xmodmap exists.</long>
-+      </locale>
-+    </schema>
-+    <schema>
-+      <key>/schemas/desktop/ibus/general/xkb_latin_layouts</key>
-+      <applyto>/desktop/ibus/general/xkb_latin_layouts</applyto>
-+      <owner>ibus</owner>
-+      <type>list</type>
-+      <list_type>string</list_type>
-+      <default>[ara,bg,cz,dev,gr,gur,in,jp(kana),mal,mkd,ru,ua]</default>
-+      <locale name="C">
-+        <short>Latin layout which have no ASCII</short>
-+           <long>us layout is appended to the latin layouts. variant is not needed.</long>
-+      </locale>
-+    </schema>
-+    <schema>
-+      <key>/schemas/desktop/ibus/general/load_xkb_layouts</key>
-+      <applyto>/desktop/ibus/general/load_xkb_layouts</applyto>
-+      <owner>ibus</owner>
-+      <type>list</type>
-+      <list_type>string</list_type>
-+      <default>[us,us(chr),us(dvorak),ad,al,am,ara,az,ba,bd,be,bg,br,bt,by,
-+de,dk,ca,ch,cn(tib),cz,ee,epo,es,et,fi,fo,fr,
-+gb,ge,ge(dsb),ge(ru),ge(os),gh,gh(akan),gh(ewe),gh(fula),gh(ga),gh(hausa),
-+gn,gr,hu,hr,ie,ie(CloGaelach),il,
-+in,
-+in(tel),in(bolnagri),iq,iq(ku),ir,ir(ku),is,it,jp,
-+kg,kh,kz,la,latam,lk,lk(tam_unicode),lt,lv,ma,ma(tifinagh),mal,mao,
-+me,mk,mm,mt,mv,ng,ng(hausa),ng,ng(igbo),ng(yoruba),nl,no,no(smi),np,
-+pk,pl,pl(csb),pt,ro,rs,ru,ru(cv),ru(kom),ru(sah),ru(tt),ru(xal),
-+se,si,sk,sy,sy(ku),th,tj,tr,ua,uz,vn
-+]</default>
-+      <locale name="C">
-+        <short>XKB layout list which is shown on ibus-setup</short>
-+           <long>XKB layout list which is shown on ibus-setup.
-+                 The format is "layout" or "layout(variant)".</long>
-+      </locale>
-+    </schema>
-+    <schema>
-       <key>/schemas/desktop/ibus/general/hotkey/trigger</key>
-       <applyto>/desktop/ibus/general/hotkey/trigger</applyto>
-       <owner>ibus</owner>
-@@ -80,6 +126,19 @@
-       </locale>
-     </schema>
-     <schema>
-+      <key>/schemas/desktop/ibus/general/hotkey/triggers-no-modifiers</key>
-+      <applyto>/desktop/ibus/general/hotkey/triggers-no-modifiers</applyto>
-+      <owner>ibus</owner>
-+      <type>list</type>
-+      <list_type>string</list_type>
-+      <default>[]</default>
-+      <locale name="C">
-+        <short>Trigger shortcut keys without modifier keys</short>
-+          <long>Trigger shortcut keys without modifier keys.
-+                The list is used by ibus-gjs.</long>
-+      </locale>
-+    </schema>
-+    <schema>
-       <key>/schemas/desktop/ibus/general/hotkey/enable_unconditional</key>
-       <applyto>/desktop/ibus/general/hotkey/enable_unconditional</applyto>
-       <owner>ibus</owner>
-diff --git a/ibus-1.0.pc.in b/ibus-1.0.pc.in
-index 9f593ab..c93a0ed 100644
---- a/ibus-1.0.pc.in
-+++ b/ibus-1.0.pc.in
-@@ -4,6 +4,7 @@ libdir=@libdir@
- includedir=@includedir@
- datadir=@datadir@
- pkgdatadir=@datadir@/ibus
-+have_ibus_gkbd=@HAVE_IBUS_GKBD@
- 
- Name: IBus
- Description: IBus Library
-diff --git a/ibus.spec.in b/ibus.spec.in
-index 334f37e..2017af9 100644
---- a/ibus.spec.in
-+++ b/ibus.spec.in
-@@ -5,6 +5,7 @@
- 
- # Build flags
- %define build_python_library 0
-+%define build_libgnomekbd 0
- 
- %define glib_ver %([ -a %{_libdir}/pkgconfig/glib-2.0.pc ] && pkg-config --modversion glib-2.0 | cut -d. -f 1,2 || echo -n "999")
- %define gconf2_version 2.12.0
-@@ -40,6 +41,10 @@ BuildRequires:  dconf-devel
- BuildRequires:  pygobject2-devel
- BuildRequires:  intltool
- BuildRequires:  iso-codes-devel
-+%if %{build_libgnomekbd}
-+BuildRequires:  libxkbfile-devel
-+BuildRequires:  libgnomekbd-devel
-+%endif
- 
- Requires:   %{name}-libs = %{version}-%{release}
- Requires:   %{name}-gtk2 = %{version}-%{release}
-@@ -52,6 +57,9 @@ Requires:   dbus-python >= %{dbus_python_version}
- Requires:   im-chooser >= %{im_chooser_version}
- Requires:   notify-python
- Requires:   librsvg2
-+%if %{build_libgnomekbd}
-+Requires:   libgnomekbd
-+%endif
- 
- Requires(post):  desktop-file-utils
- Requires(postun):  desktop-file-utils
-@@ -152,6 +160,10 @@ OPTIONS="$OPTIONS --enable-python-library"
- OPTIONS="$OPTIONS --disable-python-library"
- %endif
- 
-+%if %{build_libgnomekbd}
-+OPTIONS="$OPTIONS --enable-libgnomekbd"
-+%endif
-+
- %configure $OPTIONS
- 
- # make -C po update-gmo
-diff --git a/src/Makefile.am b/src/Makefile.am
-index 404e1d2..f00fab7 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -202,6 +202,9 @@ typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
- CLEANFILES += $(dist_gir_DATA) $(typelibs_DATA)
- endif
- 
-+ibus_sources += ibusxkbxml.c
-+ibus_headers += ibusxkbxml.h
-+
- # gen enum types
- ibusenumtypes.h: $(ibus_headers) ibusenumtypes.h.template
- 	$(AM_V_GEN) ( top_builddir=`cd $(top_builddir) && pwd`; \
-diff --git a/src/ibus.h b/src/ibus.h
-index d8e226e..f0a9456 100644
---- a/src/ibus.h
-+++ b/src/ibus.h
-@@ -47,6 +47,7 @@
- #include <ibuskeys.h>
- #include <ibusenumtypes.h>
- #include <ibushotkey.h>
-+#include <ibusxkbxml.h>
- #include <ibusxml.h>
- #include <ibusenginedesc.h>
- #include <ibusobservedpath.h>
-diff --git a/src/ibusxkbxml.c b/src/ibusxkbxml.c
-new file mode 100644
-index 0000000..f815e5d
---- /dev/null
-+++ b/src/ibusxkbxml.c
-@@ -0,0 +1,466 @@
-+/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
-+/* vim:set et sts=4: */
-+/* bus - The Input Bus
-+ * Copyright (C) 2013 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2013 Peng Huang <shawn.p.huang@gmail.com>
-+ * Copyright (C) 2013 Red Hat, Inc.
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Lesser General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
-+ * Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this library; if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ * Boston, MA 02111-1307, USA.
-+ */
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#include <glib.h>
-+
-+#include "ibus.h"
-+#include "ibusxkbxml.h"
-+
-+#ifndef XKB_RULES_XML_FILE
-+#define XKB_RULES_XML_FILE "/usr/share/X11/xkb/rules/evdev.xml"
-+#endif
-+
-+#define IBUS_XKB_CONFIG_REGISTRY_GET_PRIVATE(o)  \
-+   (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_XKB_CONFIG_REGISTRY, IBusXKBConfigRegistryPrivate))
-+
-+typedef struct _IBusXKBConfigRegistryPrivate IBusXKBConfigRegistryPrivate;
-+
-+struct _IBusXKBConfigRegistryPrivate {
-+    GHashTable *layout_list;
-+    GHashTable *layout_lang;
-+    GHashTable *layout_desc;
-+    GHashTable *variant_desc;
-+};
-+
-+
-+/* functions prototype */
-+static void         ibus_xkb_config_registry_destroy
-+                                           (IBusXKBConfigRegistry *xkb_config);
-+
-+G_DEFINE_TYPE (IBusXKBConfigRegistry, ibus_xkb_config_registry, IBUS_TYPE_OBJECT)
-+
-+static void
-+parse_xkb_xml_languagelist_node (IBusXKBConfigRegistryPrivate *priv,
-+                                 XMLNode *parent_node,
-+                                 const gchar *layout_name)
-+{
-+    XMLNode *node = parent_node;
-+    XMLNode *sub_node;
-+    GList *p;
-+    GList *lang_list = NULL;
-+
-+    g_assert (node != NULL);
-+    g_assert (layout_name != NULL);
-+    for (p = node->sub_nodes; p; p = p->next) {
-+        sub_node = (XMLNode *) p->data;
-+        if (g_strcmp0 (sub_node->name, "iso639Id") == 0) {
-+            lang_list = g_list_append (lang_list,
-+                                       (gpointer) g_strdup (sub_node->text));
-+            continue;
-+        }
-+    }
-+    if (lang_list == NULL) {
-+        /* some nodes have no lang */
-+        return;
-+    }
-+    if (g_hash_table_lookup (priv->layout_lang, layout_name) != NULL) {
-+        g_warning ("duplicated name %s exists", layout_name);
-+        return;
-+    }
-+    g_hash_table_insert (priv->layout_lang,
-+                         (gpointer) g_strdup (layout_name),
-+                         (gpointer) lang_list);
-+}
-+
-+static const gchar *
-+parse_xkb_xml_configitem_node (IBusXKBConfigRegistryPrivate *priv,
-+                               XMLNode *parent_node)
-+{
-+    XMLNode *node = parent_node;
-+    XMLNode *sub_node;
-+    GList *p;
-+    gchar *name = NULL;
-+    gchar *description = NULL;
-+
-+    g_assert (node != NULL);
-+    for (p = node->sub_nodes; p; p = p->next) {
-+        sub_node = (XMLNode *) p->data;
-+        if (g_strcmp0 (sub_node->name, "name") == 0) {
-+            name = sub_node->text;
-+            continue;
-+        }
-+        if (g_strcmp0 (sub_node->name, "description") == 0) {
-+            description = sub_node->text;
-+            continue;
-+        }
-+        if (g_strcmp0 (sub_node->name, "languageList") == 0) {
-+            if (name == NULL) {
-+                g_warning ("layout name is NULL in node %s", node->name);
-+                continue;
-+            }
-+            parse_xkb_xml_languagelist_node (priv, sub_node, name);
-+            continue;
-+        }
-+    }
-+    if (name == NULL) {
-+        g_warning ("No name in layout node");
-+        return NULL;
-+    }
-+    if (g_hash_table_lookup (priv->layout_desc, name) != NULL) {
-+        g_warning ("duplicated name %s exists", name);
-+        return name;
-+    }
-+    g_hash_table_insert (priv->layout_desc,
-+                         (gpointer) g_strdup (name),
-+                         (gpointer) g_strdup (description));
-+
-+    return name;
-+}
-+
-+static const gchar *
-+parse_xkb_xml_variant_configitem_node (IBusXKBConfigRegistryPrivate *priv,
-+                            XMLNode *parent_node,
-+                            const gchar *layout_name)
-+{
-+    XMLNode *node = parent_node;
-+    XMLNode *sub_node;
-+    GList *p;
-+    gchar *name = NULL;
-+    gchar *description = NULL;
-+    gchar *variant_lang_name = NULL;
-+
-+    g_assert (node != NULL);
-+    g_assert (layout_name != NULL);
-+    for (p = node->sub_nodes; p; p = p->next) {
-+        sub_node = (XMLNode *) p->data;
-+        if (g_strcmp0 (sub_node->name, "name") == 0) {
-+            name = sub_node->text;
-+            continue;
-+        }
-+        if (g_strcmp0 (sub_node->name, "description") == 0) {
-+            description = sub_node->text;
-+            continue;
-+        }
-+        if (g_strcmp0 (sub_node->name, "languageList") == 0) {
-+            if (name == NULL) {
-+                g_warning ("layout name is NULL in node %s", node->name);
-+                continue;
-+            }
-+            variant_lang_name = g_strdup_printf ("%s(%s)", layout_name, name);
-+            parse_xkb_xml_languagelist_node (priv, sub_node, variant_lang_name);
-+            g_free (variant_lang_name);
-+            continue;
-+        }
-+    }
-+    if (name == NULL) {
-+        g_warning ("No name in layout node");
-+        return NULL;
-+    }
-+    if (g_hash_table_lookup (priv->variant_desc, name) != NULL) {
-+        /* This is an expected case. */
-+        return name;
-+    }
-+    variant_lang_name = g_strdup_printf ("%s(%s)", layout_name, name);
-+    g_hash_table_insert (priv->variant_desc,
-+                         (gpointer) variant_lang_name,
-+                         (gpointer) g_strdup (description));
-+    return name;
-+}
-+
-+static const gchar *
-+parse_xkb_xml_variant_node (IBusXKBConfigRegistryPrivate *priv,
-+                            XMLNode *parent_node,
-+                            const gchar *layout_name)
-+{
-+    XMLNode *node = parent_node;
-+    XMLNode *sub_node;
-+    GList *p;
-+    const gchar *variant_name = NULL;
-+
-+    g_assert (node != NULL);
-+    g_assert (layout_name != NULL);
-+    for (p = node->sub_nodes; p; p = p->next) {
-+        sub_node = (XMLNode *) p->data;
-+        if (g_strcmp0 (sub_node->name, "configItem") == 0) {
-+            variant_name = parse_xkb_xml_variant_configitem_node (priv, sub_node, layout_name);
-+            continue;
-+        }
-+    }
-+    return variant_name;
-+}
-+
-+static GList *
-+parse_xkb_xml_variantlist_node (IBusXKBConfigRegistryPrivate *priv,
-+                                XMLNode *parent_node,
-+                                const gchar *layout_name,
-+                                GList *variant_list)
-+{
-+    XMLNode *node = parent_node;
-+    XMLNode *sub_node;
-+    GList *p;
-+    const gchar *variant_name = NULL;
-+
-+    g_assert (node != NULL);
-+    g_assert (layout_name != NULL);
-+    for (p = node->sub_nodes; p; p = p->next) {
-+        sub_node = (XMLNode *) p->data;
-+        if (g_strcmp0 (sub_node->name, "variant") == 0) {
-+            variant_name = parse_xkb_xml_variant_node (priv, sub_node, layout_name);
-+            if (variant_name != NULL) {
-+                variant_list = g_list_append (variant_list,
-+                                              (gpointer) g_strdup (variant_name));
-+            }
-+            continue;
-+        }
-+    }
-+    return variant_list;
-+}
-+
-+static void
-+parse_xkb_xml_layout_node (IBusXKBConfigRegistryPrivate *priv,
-+                           XMLNode *parent_node)
-+{
-+    XMLNode *node = parent_node;
-+    XMLNode *sub_node;
-+    GList *p;
-+    const gchar *name = NULL;
-+    GList *variant_list = NULL;
-+
-+    g_assert (node != NULL);
-+    for (p = node->sub_nodes; p; p = p->next) {
-+        sub_node = (XMLNode *) p->data;
-+        if (g_strcmp0 (sub_node->name, "configItem") == 0) {
-+            name = parse_xkb_xml_configitem_node (priv, sub_node);
-+            continue;
-+        }
-+        if (g_strcmp0 (sub_node->name, "variantList") == 0) {
-+            if (name == NULL) {
-+                g_warning ("layout name is NULL in node %s", node->name);
-+                continue;
-+            }
-+            variant_list = parse_xkb_xml_variantlist_node (priv, sub_node,
-+                                                           name,
-+                                                           variant_list);
-+            continue;
-+        }
-+    }
-+    if (g_hash_table_lookup (priv->layout_list, name) != NULL) {
-+        g_warning ("duplicated name %s exists", name);
-+        return;
-+    }
-+    g_hash_table_insert (priv->layout_list,
-+                         (gpointer) g_strdup (name),
-+                         (gpointer) variant_list);
-+}
-+
-+static void
-+parse_xkb_xml_top_node (IBusXKBConfigRegistryPrivate *priv,
-+                        XMLNode *parent_node)
-+{
-+    XMLNode *node = parent_node;
-+    XMLNode *sub_node;
-+    GList *p;
-+
-+    g_assert (priv != NULL);
-+    g_assert (node != NULL);
-+
-+    if (g_strcmp0 (node->name, "xkbConfigRegistry") != 0) {
-+        g_warning ("node has no xkbConfigRegistry name");
-+        return;
-+    }
-+    for (p = node->sub_nodes; p; p = p->next) {
-+        sub_node = (XMLNode *) p->data;
-+        if (g_strcmp0 (sub_node->name, "layoutList") == 0) {
-+            break;
-+        }
-+    }
-+    if (p == NULL) {
-+        g_warning ("xkbConfigRegistry node has no layoutList node");
-+        return;
-+    }
-+    node = sub_node;
-+    for (p = node->sub_nodes; p; p = p->next) {
-+        sub_node = (XMLNode *) p->data;
-+        if (g_strcmp0 (sub_node->name, "layout") == 0) {
-+            parse_xkb_xml_layout_node (priv, sub_node);
-+            continue;
-+        }
-+    }
-+}
-+
-+static void
-+free_lang_list (GList *list)
-+{
-+    GList *l = list;
-+    while (l) {
-+        g_free (l->data);
-+        l->data = NULL;
-+        l = l->next;
-+    }
-+    g_list_free (list);
-+}
-+
-+static void
-+parse_xkb_config_registry_file (IBusXKBConfigRegistryPrivate *priv,
-+                                const gchar *file)
-+{
-+    XMLNode *node;
-+
-+    g_assert (file != NULL);
-+
-+    priv->layout_list = g_hash_table_new_full (g_str_hash,
-+                                               (GEqualFunc) g_str_equal,
-+                                               (GDestroyNotify) g_free,
-+                                               (GDestroyNotify) free_lang_list);
-+    priv->layout_desc = g_hash_table_new_full (g_str_hash,
-+                                               (GEqualFunc) g_str_equal,
-+                                               (GDestroyNotify) g_free,
-+                                               (GDestroyNotify) g_free);
-+    priv->layout_lang = g_hash_table_new_full (g_str_hash,
-+                                               (GEqualFunc) g_str_equal,
-+                                               (GDestroyNotify) g_free,
-+                                               (GDestroyNotify) free_lang_list);
-+    priv->variant_desc = g_hash_table_new_full (g_str_hash,
-+                                               (GEqualFunc) g_str_equal,
-+                                               (GDestroyNotify) g_free,
-+                                               (GDestroyNotify) g_free);
-+    node = ibus_xml_parse_file (file);
-+    parse_xkb_xml_top_node (priv, node);
-+    ibus_xml_free (node);
-+}
-+
-+static void
-+ibus_xkb_config_registry_init (IBusXKBConfigRegistry *xkb_config)
-+{
-+    IBusXKBConfigRegistryPrivate *priv;
-+    const gchar *file = XKB_RULES_XML_FILE;
-+
-+    priv = IBUS_XKB_CONFIG_REGISTRY_GET_PRIVATE (xkb_config);
-+    parse_xkb_config_registry_file (priv, file);
-+}
-+
-+static void
-+ibus_xkb_config_registry_destroy (IBusXKBConfigRegistry *xkb_config)
-+{
-+    IBusXKBConfigRegistryPrivate *priv;
-+
-+    g_return_if_fail (xkb_config != NULL);
-+
-+    priv = IBUS_XKB_CONFIG_REGISTRY_GET_PRIVATE (xkb_config);
-+
-+    g_hash_table_destroy (priv->layout_list);
-+    priv->layout_list = NULL;
-+    g_hash_table_destroy (priv->layout_lang);
-+    priv->layout_lang= NULL;
-+    g_hash_table_destroy (priv->layout_desc);
-+    priv->layout_desc= NULL;
-+    g_hash_table_destroy (priv->variant_desc);
-+    priv->variant_desc = NULL;
-+
-+    IBUS_OBJECT_CLASS(ibus_xkb_config_registry_parent_class)->destroy (IBUS_OBJECT (xkb_config));
-+}
-+
-+static void
-+ibus_xkb_config_registry_class_init (IBusXKBConfigRegistryClass *klass)
-+{
-+    IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass);
-+
-+    g_type_class_add_private (klass, sizeof (IBusXKBConfigRegistryPrivate));
-+
-+    ibus_object_class->destroy = (IBusObjectDestroyFunc) ibus_xkb_config_registry_destroy;
-+}
-+
-+IBusXKBConfigRegistry *
-+ibus_xkb_config_registry_new (void)
-+{
-+    IBusXKBConfigRegistry *xkb_config;
-+
-+    xkb_config = IBUS_XKB_CONFIG_REGISTRY (g_object_new (IBUS_TYPE_XKB_CONFIG_REGISTRY, NULL));
-+    return xkb_config;
-+}
-+
-+#define TABLE_FUNC(field_name) const GHashTable *                       \
-+ibus_xkb_config_registry_get_##field_name  (IBusXKBConfigRegistry *xkb_config) \
-+{                                                                       \
-+    IBusXKBConfigRegistryPrivate *priv;                                 \
-+                                                                        \
-+    g_return_val_if_fail (xkb_config != NULL, NULL);                    \
-+    priv = IBUS_XKB_CONFIG_REGISTRY_GET_PRIVATE (xkb_config);           \
-+    return priv->field_name;                                            \
-+}
-+
-+TABLE_FUNC (layout_list)
-+TABLE_FUNC (layout_lang)
-+TABLE_FUNC (layout_desc)
-+TABLE_FUNC (variant_desc)
-+
-+#undef TABLE_FUNC
-+
-+GList *
-+ibus_xkb_config_registry_layout_list_get_layouts (IBusXKBConfigRegistry *xkb_config)
-+{
-+    GHashTable *table;
-+    GList *list = NULL;
-+
-+    table = (GHashTable *)
-+        ibus_xkb_config_registry_get_layout_list (xkb_config);
-+    list = (GList *) g_hash_table_get_keys (table);
-+    return list;
-+}
-+
-+/* vala could use GLib.List<string> for the returned pointer and
-+ * the declaration calls g_list_foreach (retval, g_free, NULL).
-+ * When I think about GLib.List<string> v.s. GLib.List, probably
-+ * I think GLib.List<string> is better for the function and set
-+ * g_strdup() here. I do not know about GJS implementation.
-+ */
-+#define TABLE_LOOKUP_LIST_FUNC(field_name, value) GList *               \
-+ibus_xkb_config_registry_##field_name##_get_##value  (IBusXKBConfigRegistry *xkb_config, const gchar *key) \
-+{                                                                       \
-+    GHashTable *table;                                                  \
-+    GList *list = NULL;                                                 \
-+    GList *retval= NULL;                                                \
-+    GList *p = NULL;                                                    \
-+                                                                        \
-+    table = (GHashTable *)                                              \
-+        ibus_xkb_config_registry_get_##field_name (xkb_config);         \
-+    list = (GList *) g_hash_table_lookup (table, key);                  \
-+    retval = g_list_copy (list);                                        \
-+    for (p = retval; p; p = p->next) {                                  \
-+        p->data = g_strdup (p->data);                                   \
-+    }                                                                   \
-+    return retval;                                                      \
-+}
-+
-+#define TABLE_LOOKUP_STRING_FUNC(field_name, value) gchar *             \
-+ibus_xkb_config_registry_##field_name##_get_##value  (IBusXKBConfigRegistry *xkb_config, const gchar *key) \
-+{                                                                       \
-+    GHashTable *table;                                                  \
-+    const gchar *desc = NULL;                                           \
-+                                                                        \
-+    table = (GHashTable *)                                              \
-+        ibus_xkb_config_registry_get_##field_name (xkb_config);         \
-+    desc = (const gchar *) g_hash_table_lookup (table, key);            \
-+    return g_strdup (desc);                                             \
-+}
-+
-+TABLE_LOOKUP_LIST_FUNC (layout_list, variants)
-+TABLE_LOOKUP_LIST_FUNC (layout_lang, langs)
-+TABLE_LOOKUP_STRING_FUNC (layout_desc, desc)
-+TABLE_LOOKUP_STRING_FUNC (variant_desc, desc)
-+
-+#undef TABLE_LOOKUP_LIST_FUNC
-+#undef TABLE_LOOKUP_STRING_FUNC
-diff --git a/src/ibusxkbxml.h b/src/ibusxkbxml.h
-new file mode 100644
-index 0000000..5aa486d
---- /dev/null
-+++ b/src/ibusxkbxml.h
-@@ -0,0 +1,187 @@
-+/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
-+/* vim:set et sts=4: */
-+/* bus - The Input Bus
-+ * Copyright (C) 2013 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2013 Peng Huang <shawn.p.huang@gmail.com>
-+ * Copyright (C) 2013 Red Hat, Inc.
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Lesser General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
-+ * Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this library; if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ * Boston, MA 02111-1307, USA.
-+ */
-+#ifndef __IBUS_XKBXML_H_
-+#define __IBUS_XKBXML_H_
-+
-+#if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION)
-+#error "Only <ibus.h> can be included directly"
-+#endif
-+
-+#include "ibus.h"
-+
-+/*
-+ * Type macros.
-+ */
-+/* define IBusXKBConfigRegistry macros */
-+#define IBUS_TYPE_XKB_CONFIG_REGISTRY                   \
-+    (ibus_xkb_config_registry_get_type ())
-+#define IBUS_XKB_CONFIG_REGISTRY(obj)                   \
-+    (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_XKB_CONFIG_REGISTRY, IBusXKBConfigRegistry))
-+#define IBUS_XKB_CONFIG_REGISTRY_CLASS(klass)           \
-+    (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_XKB_CONFIG_REGISTRY, IBusXKBConfigRegistryClass))
-+#define IBUS_IS_XKB_CONFIG_REGISTRY(obj)                \
-+    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_XKB_CONFIG_REGISTRY))
-+#define IBUS_IS_XKB_CONFIG_REGISTRY_CLASS(klass)        \
-+    (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_XKB_CONFIG_REGISTRY))
-+#define IBUS_XKB_CONFIG_REGISTRY_GET_CLASS(obj)         \
-+    (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_XKB_CONFIG_REGISTRY, IBusXKBConfigRegistryClass))
-+
-+G_BEGIN_DECLS
-+
-+typedef struct _IBusXKBConfigRegistry IBusXKBConfigRegistry;
-+typedef struct _IBusXKBConfigRegistryClass IBusXKBConfigRegistryClass;
-+
-+struct _IBusXKBConfigRegistry {
-+    IBusObject parent;
-+};
-+
-+struct _IBusXKBConfigRegistryClass {
-+    IBusObjectClass parent;
-+    /* signals */
-+    /*< private >*/
-+    /* padding */
-+    gpointer pdummy[8];
-+};
-+
-+
-+GType            ibus_xkb_config_registry_get_type
-+                                                 (void);
-+
-+/**
-+ * ibus_xkb_config_registry_new:
-+ * @returns: A newly allocated IBusXKBConfigRegistry
-+ *
-+ * New an IBusXKBConfigRegistry.
-+ */
-+IBusXKBConfigRegistry *
-+                 ibus_xkb_config_registry_new
-+                                                 (void);
-+
-+/**
-+ * ibus_xkb_config_registry_get_layout_list: (skip)
-+ * @xkb_config: An IBusXKBConfigRegistry.
-+ * @returns: A const GHashTable
-+ *
-+ * a const GHashTable
-+ */
-+const GHashTable *
-+                 ibus_xkb_config_registry_get_layout_list
-+                                                 (IBusXKBConfigRegistry *xkb_config);
-+
-+/**
-+ * ibus_xkb_config_registry_get_layout_lang: (skip)
-+ * @xkb_config: An IBusXKBConfigRegistry.
-+ * @returns: A const GHashTable
-+ *
-+ * a const GHashTable
-+ */
-+const GHashTable *
-+                 ibus_xkb_config_registry_get_layout_lang
-+                                                 (IBusXKBConfigRegistry *xkb_config);
-+
-+/**
-+ * ibus_xkb_config_registry_get_layout_desc: (skip)
-+ * @xkb_config: An IBusXKBConfigRegistry.
-+ * @returns: A const GHashTable
-+ *
-+ * a const GHashTable
-+ */
-+const GHashTable *
-+                 ibus_xkb_config_registry_get_layout_desc
-+                                                 (IBusXKBConfigRegistry *xkb_config);
-+
-+/**
-+ * ibus_xkb_config_registry_get_variant_desc: (skip)
-+ * @xkb_config: An IBusXKBConfigRegistry.
-+ * @returns: A const GHashTable
-+ *
-+ * a const GHashTable
-+ */
-+const GHashTable *
-+                 ibus_xkb_config_registry_get_variant_desc
-+                                                 (IBusXKBConfigRegistry *xkb_config);
-+
-+/**
-+ * ibus_xkb_config_registry_layout_list_get_layouts:
-+ * @xkb_config: An IBusXKBConfigRegistry.
-+ * @returns: (transfer container) (element-type utf8): A GList of layouts
-+ *
-+ * a GList of layouts
-+ */
-+GList *
-+                 ibus_xkb_config_registry_layout_list_get_layouts
-+                                                 (IBusXKBConfigRegistry *xkb_config);
-+
-+/**
-+ * ibus_xkb_config_registry_layout_list_get_variants:
-+ * @xkb_config: An IBusXKBConfigRegistry.
-+ * @layout: A layout.
-+ * @returns: (transfer container) (element-type utf8): A GList
-+ *
-+ * a GList
-+ */
-+GList *
-+                 ibus_xkb_config_registry_layout_list_get_variants
-+                                                 (IBusXKBConfigRegistry *xkb_config,
-+                                                  const gchar           *layout);
-+
-+/**
-+ * ibus_xkb_config_registry_layout_lang_get_langs:
-+ * @xkb_config: An IBusXKBConfigRegistry.
-+ * @layout: A layout.
-+ * @returns: (transfer container) (element-type utf8): A GList
-+ *
-+ * a GList
-+ */
-+GList *
-+                 ibus_xkb_config_registry_layout_lang_get_langs
-+                                                 (IBusXKBConfigRegistry *xkb_config,
-+                                                  const gchar           *layout);
-+
-+/**
-+ * ibus_xkb_config_registry_layout_desc_get_desc:
-+ * @xkb_config: An IBusXKBConfigRegistry.
-+ * @layout: A layout.
-+ * @returns: A layout description
-+ *
-+ * a layout description
-+ */
-+gchar *
-+                 ibus_xkb_config_registry_layout_desc_get_desc
-+                                                 (IBusXKBConfigRegistry *xkb_config,
-+                                                  const gchar           *layout);
-+
-+/**
-+ * ibus_xkb_config_registry_variant_desc_get_desc:
-+ * @xkb_config: An IBusXKBConfigRegistry.
-+ * @variant: A variant.
-+ * @returns: A variant description
-+ *
-+ * a variant description
-+ */
-+gchar *
-+                 ibus_xkb_config_registry_variant_desc_get_desc
-+                                                 (IBusXKBConfigRegistry *xkb_config,
-+                                                  const gchar           *variant);
-+G_END_DECLS
-+#endif
-diff --git a/ui/gtk3/Makefile.am b/ui/gtk3/Makefile.am
-index b2fb800..f148202 100644
---- a/ui/gtk3/Makefile.am
-+++ b/ui/gtk3/Makefile.am
-@@ -35,6 +35,8 @@ gtkpanel.xml: gtkpanel.xml.in
- 		-e 's|@libexecdir[@]|$(libexecdir)|g' $< > $@.tmp && \
- 		mv $@.tmp $@
- 
-+HAVE_IBUS_GKBD_C = $(strip $(subst false, FALSE, $(subst true, TRUE, $(HAVE_IBUS_GKBD))))
-+
- # force include config.h before gi18n.h.
- AM_CPPFLAGS = \
- 	-I$(top_srcdir)/src \
-@@ -51,6 +53,8 @@ AM_CFLAGS = \
- 	-DG_LOG_DOMAIN=\"IBUS\" \
- 	-DBINDIR=\"$(bindir)\" \
- 	-DIBUS_DISABLE_DEPRECATED \
-+	-DHAVE_IBUS_GKBD=$(HAVE_IBUS_GKBD_C) \
-+	-DXKB_LAYOUTS_MAX_LENGTH=4 \
- 	-Wno-unused-variable \
- 	-Wno-unused-but-set-variable \
- 	-Wno-unused-function \
-@@ -94,12 +98,40 @@ AM_VALAFLAGS += \
- 	$(NULL)
- endif
- 
-+if ENABLE_LIBGNOMEKBD
-+AM_CFLAGS += \
-+	@LIBGNOMEKBDUI_CFLAGS@ \
-+	@ATK_CFLAGS@ \
-+	$(NULL)
-+
-+AM_LDADD += \
-+	@LIBGNOMEKBDUI_LIBS@ \
-+	@ATK_LIBS@ \
-+	$(NULL)
-+
-+AM_VALAFLAGS += \
-+	--vapidir=. \
-+	--metadatadir=$(top_srcdir)/bindings/vala \
-+	--pkg=glib-2.0 \
-+	--pkg=gmodule-2.0 \
-+	--pkg=gkbd \
-+	--pkg=Xkl-1.0 \
-+	$(NULL)
-+
-+$(srcdir)/gkbdlayout.vala: $(top_builddir)/bindings/vala/gkbd.vapi
-+	@cp $(srcdir)/gkbdlayout.vala.true $(srcdir)/gkbdlayout.vala
-+else
-+$(srcdir)/gkbdlayout.vala:
-+	@cp $(srcdir)/gkbdlayout.vala.false $(srcdir)/gkbdlayout.vala
-+endif
-+
- libexec_PROGRAMS = ibus-ui-gtk3
- 
- ibus_ui_gtk3_SOURCES = \
- 	application.vala \
- 	candidatearea.vala \
- 	candidatepanel.vala \
-+	gkbdlayout.vala \
- 	handle.vala \
- 	iconwidget.vala \
- 	keybindingmanager.vala \
-@@ -109,6 +141,7 @@ ibus_ui_gtk3_SOURCES = \
- 	propertypanel.vala \
- 	separator.vala \
- 	switcher.vala \
-+	xkblayout.vala \
- 	$(NULL)
- 
- ibus_ui_gtk3_LDADD = \
-@@ -117,9 +150,12 @@ ibus_ui_gtk3_LDADD = \
- 
- CLEANFILES = \
- 	gtkpanel.xml \
-+	gkbdlayout.vala \
- 	$(NULL)
- 
- EXTRA_DIST = \
-+	gkbdlayout.vala.false \
-+	gkbdlayout.vala.true \
- 	gtkpanel.xml.in \
- 	$(NULL)
- 
-diff --git a/ui/gtk3/gkbdlayout.vala.false b/ui/gtk3/gkbdlayout.vala.false
-new file mode 100644
-index 0000000..506aff2
---- /dev/null
-+++ b/ui/gtk3/gkbdlayout.vala.false
-@@ -0,0 +1,63 @@
-+/* vim:set et sts=4 sw=4:
-+ *
-+ * ibus - The Input Bus
-+ *
-+ * Copyright(c) 2013 Red Hat, Inc.
-+ * Copyright(c) 2013 Peng Huang <shawn.p.huang@gmail.com>
-+ * Copyright(c) 2013 Takao Fujiwara <tfujiwar@redhat.com>
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Lesser General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2 of the License, or(at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this program; if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
-+ * Boston, MA  02111-1307  USA
-+ */
-+
-+public class GkbdLayout
-+{
-+    public signal void changed();
-+    public signal void group_changed (int object);
-+
-+    public GkbdLayout() {
-+    }
-+
-+    public string[] get_layouts() {
-+        return new string[0];
-+    }
-+
-+    public string[] get_group_names() {
-+        return new string[0];
-+    }
-+
-+    public void lock_group(int id) {
-+    }
-+
-+    public void start_listen() {
-+    }
-+
-+    public void stop_listen() {
-+    }
-+
-+    /*
-+    public static int main(string[] args) {
-+        GkbdLayout ibus_layouts = new GkbdLayout();
-+
-+        string[] layouts = ibus_layouts.get_layouts();
-+        string[] names = ibus_layouts.get_group_names();
-+        for (int i = 0; layouts != null && i < layouts.length; i++) {
-+            stdout.printf("%s %s\n", layouts[i], names[i]);
-+        }
-+
-+        return 0;
-+    }
-+    */
-+}
-diff --git a/ui/gtk3/gkbdlayout.vala.true b/ui/gtk3/gkbdlayout.vala.true
-new file mode 100644
-index 0000000..a6e0f8d
---- /dev/null
-+++ b/ui/gtk3/gkbdlayout.vala.true
-@@ -0,0 +1,108 @@
-+/* vim:set et sts=4 sw=4:
-+ *
-+ * ibus - The Input Bus
-+ *
-+ * Copyright(c) 2013 Red Hat, Inc.
-+ * Copyright(c) 2013 Peng Huang <shawn.p.huang@gmail.com>
-+ * Copyright(c) 2013 Takao Fujiwara <tfujiwar@redhat.com>
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Lesser General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2 of the License, or(at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this program; if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
-+ * Boston, MA  02111-1307  USA
-+ */
-+
-+public class GkbdLayout
-+{
-+    public signal void changed();
-+    public signal void group_changed (int object);
-+
-+    private Gkbd.Configuration m_config = null;
-+
-+    public GkbdLayout() {
-+        m_config = Gkbd.Configuration.get();
-+        if (m_config != null) {
-+            m_config.changed.connect(config_changed_cb);
-+            m_config.group_changed.connect(config_group_changed_cb);
-+        }
-+    }
-+
-+    ~GkbdLayout() {
-+        if (m_config != null) {
-+            m_config.changed.disconnect(config_changed_cb);
-+            m_config.group_changed.disconnect(config_group_changed_cb);
-+            /* gkbd_configuration_get reuses the object and do not
-+             * destroy m_config here. */
-+            m_config.ref();
-+            m_config = null;
-+        }
-+    }
-+
-+    private void config_changed_cb() {
-+        changed();
-+    }
-+
-+    private void config_group_changed_cb(int object) {
-+        group_changed(object);
-+    }
-+
-+    public string[] get_layouts() {
-+        if (m_config == null) {
-+            return new string[0];
-+        }
-+        return m_config.get_short_group_names();
-+    }
-+
-+    public string[] get_group_names() {
-+        if (m_config == null) {
-+            return new string[0];
-+        }
-+        return m_config.get_group_names();
-+    }
-+
-+    public void lock_group(int id) {
-+        if (m_config == null) {
-+            return;
-+        }
-+        m_config.lock_group(id);
-+    }
-+
-+    public void start_listen() {
-+        if (m_config == null) {
-+            return;
-+        }
-+        m_config.start_listen();
-+    }
-+
-+    public void stop_listen() {
-+        if (m_config == null) {
-+            return;
-+        }
-+        m_config.stop_listen();
-+    }
-+
-+    /*
-+    public static int main(string[] args) {
-+        Gtk.init(ref args);
-+        GkbdLayout ibus_layouts = new GkbdLayout();
-+
-+        string[] layouts = ibus_layouts.get_layouts();
-+        string[] names = ibus_layouts.get_group_names();
-+        for (int i = 0; layouts != null && i < layouts.length; i++) {
-+            stdout.printf("%s %s\n", layouts[i], names[i]);
-+        }
-+
-+        return 0;
-+    }
-+    */
-+}
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index 748cb32..7a15049 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -63,6 +63,13 @@ class Panel : IBus.PanelService {
-                                                    GLib.str_equal);
-     private Gdk.RGBA m_xkb_icon_rgba = Gdk.RGBA(){
-             red = 0.0, green = 0.0, blue = 0.0, alpha = 1.0 };
-+    private GkbdLayout m_gkbdlayout = null;
-+    private XKBLayout m_xkblayout = null;
-+    private string[] m_layouts = {};
-+    private string[] m_variants = {};
-+    private int m_fallback_lock_id = -1;
-+    private bool m_changed_xkb_option = false;
-+    private GLib.Timer m_changed_layout_timer;
- 
-     private GLib.List<Keybinding> m_keybindings = new GLib.List<Keybinding>();
- 
-@@ -113,6 +120,14 @@ class Panel : IBus.PanelService {
- 
-     ~Panel() {
-         unbind_switch_shortcut();
-+
-+        if (HAVE_IBUS_GKBD && m_gkbdlayout != null) {
-+            m_gkbdlayout.changed.disconnect(gkbdlayout_changed_cb);
-+            m_gkbdlayout.stop_listen();
-+            m_gkbdlayout = null;
-+        }
-+
-+        m_xkblayout = null;
-     }
- 
-     private void init_settings() {
-@@ -487,6 +502,7 @@ class Panel : IBus.PanelService {
-     }
- 
-     public void load_settings() {
-+        init_engines_order();
-         // Update m_use_system_keyboard_layout before update_engines()
-         // is called.
-         set_use_system_keyboard_layout();
-@@ -508,6 +524,184 @@ class Panel : IBus.PanelService {
-         set_version();
-     }
- 
-+    private void gkbdlayout_changed_cb() {
-+        /* The callback is called four times after set_layout is called
-+         * so check the elapsed and take the first signal only. */
-+        double elapsed = m_changed_layout_timer.elapsed();
-+        if (elapsed < 1.0 && elapsed > 0.0) {
-+            return;
-+        }
-+
-+        if (m_fallback_lock_id != -1) {
-+            /* Call lock_group only when set_layout is called. */
-+            m_gkbdlayout.lock_group(m_fallback_lock_id);
-+            m_fallback_lock_id = -1;
-+        } else {
-+            /* Reset default layout when gnome-control-center is called. */
-+            m_xkblayout.reset_layout();
-+        }
-+
-+        update_xkb_engines();
-+        m_changed_layout_timer.reset();
-+    }
-+
-+    private void init_gkbd() {
-+        m_gkbdlayout = new GkbdLayout();
-+        m_gkbdlayout.changed.connect(gkbdlayout_changed_cb);
-+
-+        /* Probably we cannot support both keyboard and ibus indicators
-+         * How can I get the engine from keymap of group_id?
-+         * e.g. 'en' could be owned by xkb:en and pinyin engines. */
-+        //m_gkbdlayout.group_changed.connect((object) => {});
-+
-+        m_changed_layout_timer = new GLib.Timer();
-+        m_changed_layout_timer.start();
-+        m_gkbdlayout.start_listen();
-+    }
-+
-+    private void init_engines_order() {
-+        m_xkblayout = new XKBLayout();
-+        string session = Environment.get_variable("DESKTOP_SESSION");
-+
-+        if (HAVE_IBUS_GKBD &&
-+            session != null && session.length >= 5 &&
-+            session[0:5] == "gnome") {
-+            init_gkbd();
-+        }
-+
-+        update_xkb_engines();
-+    }
-+
-+    private void update_xkb_engines() {
-+        string var_layout = m_xkblayout.get_layout();
-+        string var_variant = m_xkblayout.get_variant();
-+        if (var_layout == "") {
-+            return;
-+        }
-+
-+        m_layouts = var_layout.split(",");
-+        m_variants = var_variant.split(",");
-+
-+        IBus.XKBConfigRegistry registry = new IBus.XKBConfigRegistry();
-+        string[] var_xkb_engine_names = {};
-+        for (int i = 0; i < m_layouts.length; i++) {
-+            string name = m_layouts[i];
-+            string lang = null;
-+
-+            if (i < m_variants.length && m_variants[i] != "") {
-+                name = "%s:%s".printf(name, m_variants[i]);
-+                string layout = "%s(%s)".printf(name, m_variants[i]);
-+                GLib.List<string> langs =
-+                        registry.layout_lang_get_langs(layout);
-+                if (langs.length() != 0) {
-+                    lang = langs.data;
-+                }
-+            } else {
-+                name = "%s:".printf(name);
-+            }
-+
-+            if (lang == null) {
-+                GLib.List<string> langs =
-+                        registry.layout_lang_get_langs(m_layouts[i]);
-+                if (langs.length() != 0) {
-+                    lang = langs.data;
-+                }
-+            }
-+
-+            var_xkb_engine_names += "%s:%s:%s".printf("xkb", name, lang);
-+        }
-+
-+        string[] engine_names =
-+                m_settings_general.get_strv("preload-engines");
-+        bool updated_engine_names = false;
-+
-+        foreach (string name in var_xkb_engine_names) {
-+            if (name in engine_names)
-+                continue;
-+            updated_engine_names = true;
-+            engine_names += name;
-+        }
-+
-+        if (updated_engine_names)
-+            m_settings_general.set_strv("preload-engines", engine_names);
-+
-+        string[] order_names =
-+                m_settings_general.get_strv("engines-order");
-+        bool updated_order_names = false;
-+
-+        foreach (var name in var_xkb_engine_names) {
-+            if (name in order_names)
-+                continue;
-+            order_names += name;
-+            updated_order_names = true;
-+        }
-+
-+        if (updated_order_names)
-+            m_settings_general.set_strv("engines-order", order_names);
-+    }
-+
-+    private void set_xkb_group_layout(IBus.EngineDesc engine) {
-+        int[] retval = m_xkblayout.set_layout(engine, true);
-+        if (retval[0] >= 0) {
-+            /* If an XKB keymap is added into the XKB group,
-+             * this._gkbdlayout.lock_group will be called after
-+             * 'group-changed' signal is received. */
-+            m_fallback_lock_id = retval[0];
-+            m_changed_xkb_option = (retval[1] != 0) ? true : false;
-+        }
-+    }
-+
-+    private bool set_gkbd_layout(IBus.EngineDesc engine) {
-+        string layout = engine.get_layout();
-+        string variant = engine.get_layout_variant();
-+
-+        /* If a previous ibus engine changed XKB options, need to set the
-+         * default XKB option. */
-+        if (m_changed_xkb_option == true) {
-+            m_changed_xkb_option = false;
-+            return false;
-+        }
-+
-+        if (variant != "" && variant != "default") {
-+            layout = "%s(%s)".printf(layout, variant);
-+        }
-+
-+        int gkbd_len = m_gkbdlayout.get_group_names().length;
-+        for (int i = 0; i < m_layouts.length && i < gkbd_len; i++) {
-+            string sys_layout = m_layouts[i];
-+            if (i < m_variants.length && m_variants[i] != "") {
-+                sys_layout = "%s(%s)".printf(sys_layout, m_variants[i]);
-+            }
-+            if (sys_layout == layout) {
-+                m_gkbdlayout.lock_group(i);
-+                return true;
-+            }
-+        }
-+        return false;
-+    }
-+
-+    private void set_layout(IBus.EngineDesc engine) {
-+        string layout = engine.get_layout();
-+
-+        if (layout == "" || layout == null) {
-+            return;
-+        }
-+
-+        if (m_xkblayout == null) {
-+            init_engines_order();
-+        }
-+
-+        if (HAVE_IBUS_GKBD && m_gkbdlayout != null) {
-+            if (set_gkbd_layout(engine)) {
-+                return;
-+            }
-+            set_xkb_group_layout(engine);
-+            return;
-+        }
-+
-+        m_xkblayout.set_layout(engine);
-+    }
-+
-     private void exec_setxkbmap(IBus.EngineDesc engine) {
-         string layout = engine.get_layout();
-         string variant = engine.get_layout_variant();
-@@ -573,7 +767,7 @@ class Panel : IBus.PanelService {
- 
-         // set xkb layout
-         if (!m_use_system_keyboard_layout)
--            exec_setxkbmap(engine);
-+            set_layout(engine);
- 
-         engine_contexts_insert(engine);
-     }
-@@ -636,6 +830,39 @@ class Panel : IBus.PanelService {
-         }
-     }
- 
-+    /* IBus.Bus.get_engines_by_names() returns 'us' engine if the name 
-+     * does not exist in simple.xml and 'us' engine could be duplicated.
-+     */
-+    private IBus.EngineDesc[] uniq_engines(IBus.EngineDesc[] engines) {
-+        if (engines.length == 0)
-+            return engines;
-+
-+        int i = 0;
-+        IBus.EngineDesc[] retval = {};
-+
-+        for (; i < engines.length; i++) {
-+            if (engines[i].get_name() == "xkb:us::eng")
-+                break;
-+        }
-+
-+        if (i == engines.length)
-+            return engines;
-+
-+        for (int j = 0; j < engines.length; j++) {
-+            if (j <= i) {
-+                retval += engines[j];
-+                continue;
-+            }
-+
-+            if (engines[i].get_name() == engines[j].get_name())
-+                continue;
-+
-+            retval += engines[j];
-+        }
-+
-+        return retval;
-+    }
-+
-     private void run_preload_engines(IBus.EngineDesc[] engines, int index) {
-         string[] names = {};
- 
-@@ -668,6 +895,7 @@ class Panel : IBus.PanelService {
-         }
- 
-         var engines = m_bus.get_engines_by_names(names);
-+        engines = uniq_engines(engines);
- 
-         if (m_engines.length == 0) {
-             m_engines = engines;
-diff --git a/ui/gtk3/xkblayout.vala b/ui/gtk3/xkblayout.vala
-new file mode 100644
-index 0000000..b7dfb3e
---- /dev/null
-+++ b/ui/gtk3/xkblayout.vala
-@@ -0,0 +1,429 @@
-+/* vim:set et sts=4 sw=4:
-+ *
-+ * ibus - The Input Bus
-+ *
-+ * Copyright(c) 2013 Red Hat, Inc.
-+ * Copyright(c) 2013 Peng Huang <shawn.p.huang@gmail.com>
-+ * Copyright(c) 2013 Takao Fujiwara <tfujiwar@redhat.com>
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Lesser General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2 of the License, or(at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this program; if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
-+ * Boston, MA  02111-1307  USA
-+ */
-+
-+public extern const bool HAVE_IBUS_GKBD;
-+public extern const int XKB_LAYOUTS_MAX_LENGTH;
-+
-+class XKBLayout
-+{
-+    string m_xkb_command = "setxkbmap";
-+    GLib.Settings m_settings_general;
-+    string[] m_xkb_latin_layouts = {};
-+    GLib.Pid m_xkb_pid = -1;
-+    GLib.Pid m_xmodmap_pid = -1;
-+    string m_xmodmap_command = "xmodmap";
-+    bool m_use_xmodmap = true;
-+    string[] m_xmodmap_known_files = {".xmodmap", ".xmodmaprc",
-+                                      ".Xmodmap", ".Xmodmaprc"};
-+    string m_default_layout = "";
-+    string m_default_variant = "";
-+    string m_default_option = "";
-+
-+    public XKBLayout() {
-+        m_settings_general = new GLib.Settings("org.freedesktop.ibus.general");
-+
-+        var value  = m_settings_general.get_value("xkb-latin-layouts");
-+        for (int i = 0; value != null && i < value.n_children(); i++) {
-+            m_xkb_latin_layouts +=
-+                    value.get_child_value(i).dup_string();
-+        }
-+        if (m_use_xmodmap) {
-+            m_use_xmodmap = m_settings_general.get_boolean("use-xmodmap");
-+        }
-+    }
-+
-+    private string get_output_from_cmdline(string arg, string element) {
-+        string[] exec_command = {};
-+        exec_command += m_xkb_command;
-+        exec_command += arg;
-+        string standard_output = null;
-+        string standard_error = null;
-+        int exit_status = 0;
-+        string retval = "";
-+        try {
-+            GLib.Process.spawn_sync(null,
-+                                    exec_command,
-+                                    null,
-+                                    GLib.SpawnFlags.SEARCH_PATH,
-+                                    null,
-+                                    out standard_output,
-+                                    out standard_error,
-+                                    out exit_status);
-+        } catch (GLib.SpawnError err) {
-+            stderr.printf("IBUS_ERROR: %s\n", err.message);
-+        }
-+        if (exit_status != 0) {
-+            stderr.printf("IBUS_ERROR: %s\n", standard_error ?? "");
-+        }
-+        if (standard_output == null) {
-+            return "";
-+        }
-+        foreach (string line in standard_output.split("\n")) {
-+            if (element.length <= line.length &&
-+                line[0:element.length] == element) {
-+                retval = line[element.length:line.length];
-+                if (retval == null) {
-+                    retval = "";
-+                } else {
-+                    retval = retval.strip();
-+                }
-+            }
-+        }
-+        return retval;
-+    }
-+
-+    private void set_layout_cb(GLib.Pid pid, int status) {
-+        if (m_xkb_pid != pid) {
-+            stderr.printf("IBUS_ERROR: set_layout_cb has another pid\n");
-+            return;
-+        }
-+        GLib.Process.close_pid(m_xkb_pid);
-+        m_xkb_pid = -1;
-+        set_xmodmap();
-+    }
-+
-+    private void set_xmodmap_cb(GLib.Pid pid, int status) {
-+        if (m_xmodmap_pid != pid) {
-+            stderr.printf("IBUS_ERROR: set_xmodmap_cb has another pid\n");
-+            return;
-+        }
-+        GLib.Process.close_pid(m_xmodmap_pid);
-+        m_xmodmap_pid = -1;
-+    }
-+
-+    private string get_fullpath(string command) {
-+        string envpath = GLib.Environment.get_variable("PATH");
-+        foreach (string dir in envpath.split(":")) {
-+            string filepath = GLib.Path.build_filename(dir, command);
-+            if (GLib.FileUtils.test(filepath, GLib.FileTest.EXISTS)) {
-+                return filepath;
-+            }
-+        }
-+        return "";
-+    }
-+
-+    private string[] get_xkb_group_layout (string layout,
-+                                           string variant,
-+                                           int layouts_max_length) {
-+        int group_id = 0;
-+        int i = 0;
-+        string[] layouts = m_default_layout.split(",");
-+        string[] variants = m_default_variant.split(",");
-+        string group_layouts = "";
-+        string group_variants = "";
-+        bool has_variant = false;
-+        bool include_keymap = false;
-+
-+        for (i = 0; i < layouts.length; i++) {
-+            if (i >= layouts_max_length - 1) {
-+                break;
-+            }
-+
-+            if (i == 0) {
-+                group_layouts = layouts[i];
-+            } else {
-+                group_layouts = "%s,%s".printf(group_layouts, layouts[i]);
-+            }
-+
-+            if (i >= variants.length) {
-+                if (i == 0) {
-+                    group_variants = "";
-+                } else {
-+                    group_variants += ",";
-+                }
-+                if (layout == layouts[i] && variant == "") {
-+                    include_keymap = true;
-+                    group_id = i;
-+                }
-+                continue;
-+            }
-+            if (layout == layouts[i] && variant == variants[i]) {
-+                include_keymap = true;
-+                group_id = i;
-+            }
-+
-+            if (variants[i] != "") {
-+                has_variant = true;
-+            }
-+
-+            if (i == 0) {
-+                group_variants = variants[i];
-+            } else {
-+                group_variants = "%s,%s".printf(group_variants, variants[i]);
-+            }
-+        }
-+
-+        if (variant != "") {
-+            has_variant = true;
-+        }
-+
-+        if (!include_keymap) {
-+            group_layouts = "%s,%s".printf(group_layouts, layout);
-+            group_variants = "%s,%s".printf(group_variants, variant);
-+            group_id = i;
-+        }
-+
-+        if (!has_variant) {
-+            group_variants = null;
-+        }
-+
-+        return {group_layouts, group_variants, group_id.to_string()};
-+    }
-+
-+    public string[] get_variant_from_layout(string layout) {
-+        int left_bracket = layout.index_of("(");
-+        int right_bracket = layout.index_of(")");
-+        if (left_bracket >= 0 && right_bracket > left_bracket) {
-+            return {layout[0:left_bracket] +
-+                    layout[right_bracket + 1:layout.length],
-+                    layout[left_bracket + 1:right_bracket]};
-+        }
-+        return {layout, "default"};
-+    }
-+
-+    public string[] get_option_from_layout(string layout) {
-+        int left_bracket = layout.index_of("[");
-+        int right_bracket = layout.index_of("]");
-+        if (left_bracket >= 0 && right_bracket > left_bracket) {
-+            return {layout[0:left_bracket] +
-+                    layout[right_bracket + 1:layout.length],
-+                    layout[left_bracket + 1:right_bracket]};
-+        }
-+        return {layout, "default"};
-+    }
-+
-+    public string get_layout() {
-+        return get_output_from_cmdline("-query", "layout: ");
-+    }
-+
-+    public string get_variant() {
-+        return get_output_from_cmdline("-query", "variant: ");
-+    }
-+
-+    public string get_option() {
-+        return get_output_from_cmdline("-query", "options: ");
-+    }
-+
-+    /*
-+    public string get_group() {
-+        return get_output_from_cmdline("--get-group", "group: ");
-+    }
-+    */
-+
-+    public int[] set_layout(IBus.EngineDesc engine,
-+                            bool use_group_layout=false) {
-+        string layout = engine.get_layout();
-+        string variant = engine.get_layout_variant();
-+        string option = engine.get_layout_option();
-+
-+        assert (layout != null);
-+
-+        int xkb_group_id = 0;
-+        int changed_option = 0;
-+
-+        if (m_xkb_pid != -1) {
-+            return {-1, 0};
-+        }
-+
-+        if (layout == "default" &&
-+            (variant == "default" || variant == "") &&
-+            (option == "default" || option == "")) {
-+            return {-1, 0};
-+        }
-+
-+        bool need_us_layout = false;
-+        foreach (string latin_layout in m_xkb_latin_layouts) {
-+            if (layout == latin_layout && variant != "eng") {
-+                need_us_layout = true;
-+                break;
-+            }
-+            if (variant != null &&
-+                "%s(%s)".printf(layout, variant) == latin_layout) {
-+                need_us_layout = true;
-+                break;
-+            }
-+        }
-+
-+        int layouts_max_length =  XKB_LAYOUTS_MAX_LENGTH;
-+        if (need_us_layout) {
-+            layouts_max_length--;
-+        }
-+
-+        if (m_default_layout == "") {
-+            m_default_layout = get_layout();
-+        }
-+        if (m_default_variant  == "") {
-+            m_default_variant  = get_variant();
-+        }
-+        if (m_default_option == "") {
-+            m_default_option = get_option();
-+        }
-+
-+        if (layout == "default") {
-+            layout = m_default_layout;
-+            variant = m_default_variant;
-+        } else {
-+            if (use_group_layout) {
-+                if (variant == "default") {
-+                    variant = "";
-+                }
-+                string[] retval = get_xkb_group_layout (layout, variant,
-+                                                        layouts_max_length);
-+                layout = retval[0];
-+                variant = retval[1];
-+                xkb_group_id = int.parse(retval[2]);
-+            }
-+        }
-+
-+        if (layout == "") {
-+            warning("Could not get the correct layout");
-+            return {-1, 0};
-+        }
-+
-+        if (variant == "default" || variant == "") {
-+            variant = null;
-+        }
-+
-+        if (option == "default" || option == "") {
-+            option = m_default_option;
-+        } else {
-+            if (!(option in m_default_option.split(","))) {
-+                option = "%s,%s".printf(m_default_option, option);
-+                changed_option = 1;
-+            } else {
-+                option = m_default_option;
-+            }
-+        }
-+
-+        if (option == "") {
-+            option = null;
-+        }
-+
-+        if (need_us_layout) {
-+            layout += ",us";
-+            if (variant != null) {
-+                variant += ",";
-+            }
-+        }
-+
-+        string[] args = {};
-+        args += m_xkb_command;
-+        args += "-layout";
-+        args += layout;
-+        if (variant != null) {
-+            args += "-variant";
-+            args += variant;
-+        }
-+        if (option != null) {
-+            /* TODO: Need to get the session XKB options */
-+            args += "-option";
-+            args += "-option";
-+            args += option;
-+        }
-+
-+        GLib.Pid child_pid;
-+        try {
-+            GLib.Process.spawn_async(null,
-+                                     args,
-+                                     null,
-+                                     GLib.SpawnFlags.DO_NOT_REAP_CHILD |
-+                                         GLib.SpawnFlags.SEARCH_PATH,
-+                                     null,
-+                                     out child_pid);
-+        } catch (GLib.SpawnError err) {
-+            stderr.printf("Execute setxkbmap failed: %s\n", err.message);
-+            return {-1, 0};
-+        }
-+        m_xkb_pid = child_pid;
-+        GLib.ChildWatch.add(m_xkb_pid, set_layout_cb);
-+
-+        return {xkb_group_id, changed_option};
-+    }
-+
-+    public void set_xmodmap() {
-+        if (!m_use_xmodmap) {
-+            return;
-+        }
-+
-+        if (m_xmodmap_pid != -1) {
-+            return;
-+        }
-+
-+        string xmodmap_cmdpath = get_fullpath(m_xmodmap_command);
-+        if (xmodmap_cmdpath == "") {
-+            xmodmap_cmdpath = m_xmodmap_command;
-+        }
-+        string homedir = GLib.Environment.get_home_dir();
-+        foreach (string xmodmap_file in m_xmodmap_known_files) {
-+            string xmodmap_filepath = GLib.Path.build_filename(homedir, xmodmap_file);
-+            if (!GLib.FileUtils.test(xmodmap_filepath, GLib.FileTest.EXISTS)) {
-+                continue;
-+            }
-+            string[] args = {xmodmap_cmdpath, xmodmap_filepath};
-+
-+            GLib.Pid child_pid;
-+            try {
-+                GLib.Process.spawn_async(null,
-+                                         args,
-+                                         null,
-+                                         GLib.SpawnFlags.DO_NOT_REAP_CHILD |
-+                                             GLib.SpawnFlags.SEARCH_PATH,
-+                                         null,
-+                                         out child_pid);
-+            } catch (GLib.SpawnError err) {
-+                stderr.printf("IBUS_ERROR: %s\n", err.message);
-+                return;
-+            }
-+            m_xmodmap_pid = child_pid;
-+            GLib.ChildWatch.add(m_xmodmap_pid, set_xmodmap_cb);
-+
-+            break;
-+        }
-+    }
-+
-+    public void reset_layout() {
-+        m_default_layout = get_layout();
-+        m_default_variant = get_variant();
-+        m_default_option = get_option();
-+    }
-+
-+    /*
-+    public static int main(string[] args) {
-+        IBus.Bus bus = new IBus.Bus();
-+        IBus.Config config = bus.get_config();
-+        XKBLayout xkblayout = new XKBLayout(config);
-+        stdout.printf ("layout: %s\n", xkblayout.get_layout());
-+        stdout.printf ("variant: %s\n", xkblayout.get_variant());
-+        stdout.printf ("option: %s\n", xkblayout.get_option());
-+        xkblayout.set_layout("jp");
-+        if (config != null) {
-+            IBus.main();
-+        } else {
-+            Gtk.init (ref args);
-+            Gtk.main();
-+        }
-+        return 0;
-+    }
-+    */
-+}
--- 
-1.8.5.3
-

diff --git a/ibus-810211-no-switch-by-no-trigger.patch b/ibus-810211-no-switch-by-no-trigger.patch
deleted file mode 100644
index 82a2d89..0000000
--- a/ibus-810211-no-switch-by-no-trigger.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From d3bc903b487bb301395947f692ce0d8c130874e3 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sat, 6 Oct 2012 17:54:27 +0900
-Subject: [PATCH] Fix not to switch engines by non-trigger keys.
-
----
- ui/gtk3/switcher.vala | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/ui/gtk3/switcher.vala b/ui/gtk3/switcher.vala
-index 4a02743..c606682 100644
---- a/ui/gtk3/switcher.vala
-+++ b/ui/gtk3/switcher.vala
-@@ -140,6 +140,7 @@ class Switcher : Gtk.Window {
-         /* Let gtk recalculate the window size. */
-         resize(1, 1);
- 
-+        m_result = 0;
-         m_selected_engine = index;
-         m_label.set_text(m_buttons[index].longname);
-         m_buttons[index].grab_focus();
-@@ -378,6 +379,11 @@ class Switcher : Gtk.Window {
-                     break;
-                 default:
-                     debug("0x%04x", pe.keyval);
-+                    if (m_loop != null) {
-+                        m_loop.quit();
-+                        m_loop = null;
-+                    }
-+                    retval = false;
-                     break;
-             }
-         } while (false);
--- 
-1.8.0
-

diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
index 316e140..8b13789 100644
--- a/ibus-HEAD.patch
+++ b/ibus-HEAD.patch
@@ -1,1689 +1 @@
-From 0be4664b2ea3071c01ff479443033eb1accdfb03 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 2 May 2014 11:55:08 +0900
-Subject: [PATCH] Set max-width-chars property in ibus-setup wrapped
- GtkLabel.
-
-If GtkWindow has 'resizable' property = FALSE, the wrap in GtkLabel
-is not done automatically and need to set 'max-width-chars' property.
-
-TEST=ibus-setup
-
-Review URL: https://codereview.appspot.com/92940043
----
- setup/setup.ui | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/setup/setup.ui b/setup/setup.ui
-index 5ffbe47..bb78433 100644
---- a/setup/setup.ui
-+++ b/setup/setup.ui
-@@ -902,6 +902,7 @@
-                                 <property name="can_focus">False</property>
-                                 <property name="xalign">0</property>
-                                 <property name="wrap">True</property>
-+                                <property name="max_width_chars">74</property>
-                                 <property name="label" translatable="yes">&lt;small&gt;&lt;i&gt;The active input method can be switched around from the selected ones in the above list by pressing the keyboard shortcut keys or clicking the panel icon.&lt;/i&gt;&lt;/small&gt;</property>
-                                 <property name="use_markup">True</property>
-                               </object>
--- 
-1.8.5.3
-
-From 318836a647460e28dcc682543a118567474f9854 Mon Sep 17 00:00:00 2001
-From: Eike Hein <hein@kde.org>
-Date: Thu, 8 May 2014 11:16:02 +0900
-Subject: [PATCH] Add the nodeadkeys variant of the German keyboard layout.
-
-BUG=http://code.google.com/p/ibus/issues/detail?id=1710
-
-Review URL: https://codereview.appspot.com/96040043
-Patch from Eike Hein <hein@kde.org>.
----
- engine/simple.xml.in | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
-diff --git a/engine/simple.xml.in b/engine/simple.xml.in
-index b3ac6a5..9736421 100644
---- a/engine/simple.xml.in
-+++ b/engine/simple.xml.in
-@@ -330,6 +330,18 @@
-                         <icon>ibus-keyboard</icon>
- 			<rank>99</rank>
- 		</engine>
-+                <engine>
-+                        <name>xkb:de:nodeadkeys:ger</name>
-+                        <language>ger</language>
-+                        <license>GPL</license>
-+                        <author>Peng Huang &lt;shawn.p.huang@gmail.com&gt;</author>
-+                        <layout>de</layout>
-+                        <layout_variant>nodeadkeys</layout_variant>
-+                        <longname>German (eliminate dead keys)</longname>
-+                        <description>German (eliminate dead keys)</description>
-+                        <icon>ibus-keyboard</icon>
-+                        <rank>99</rank>
-+                </engine>
- 		<engine>
- 			<name>xkb:gr::gre</name>
- 			<language>gre</language>
--- 
-1.8.5.3
-
-From 386bafb0b91a61d51385e0bba2b3fc4b1e2d9013 Mon Sep 17 00:00:00 2001
-From: Ryu Changwoo <ryu.changwoo@gmail.com>
-Date: Thu, 8 May 2014 11:23:14 +0900
-Subject: [PATCH] Delete Korean keymap.
-
-BUG=http://code.google.com/p/ibus/issues/detail?id=1708
-
-Review URL: https://codereview.appspot.com/92090043
-Patch from Ryu Changwoo <ryu.changwoo@gmail.com>.
----
- engine/simple.xml.in | 12 ------------
- 1 file changed, 12 deletions(-)
-
-diff --git a/engine/simple.xml.in b/engine/simple.xml.in
-index 9736421..1b617f8 100644
---- a/engine/simple.xml.in
-+++ b/engine/simple.xml.in
-@@ -682,17 +682,5 @@
-                         <icon>ibus-keyboard</icon>
- 			<rank>99</rank>
- 		</engine>
--		<engine>
--			<name>xkb:kr:kr104:kor</name>
--			<language>kor</language>
--			<license>GPL</license>
--			<author>Peng Huang &lt;shawn.p.huang@gmail.com&gt;</author>
--			<layout>kr</layout>
--			<layout_variant>kr104</layout_variant>
--			<longname>Korean (101/104 key compatible)</longname>
--			<description>Korean (101/104 key compatible)</description>
--                        <icon>ibus-keyboard</icon>
--			<rank>99</rank>
--		</engine>
- 	</engines>
- </component>
--- 
-1.8.5.3
-
-From 34692850bd58543e016e35ea7c863d311ca92519 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 9 May 2014 11:40:21 +0900
-Subject: [PATCH] Let ibus-ui-gtk3 not to show zero-lenght preedit text.
-
-preedit text is shown by ibus-ui-gtk3 on X11 applications
-and do not have to show it likes GTK+ when the lenght is zero.
-
-BUG=http://code.google.com/p/ibus/issues/detail?id=1709
-TEST=ibus-ui-gtk3 with ibus-pinyin and x11 applications
-
-Review URL: https://codereview.appspot.com/93150043
----
- ui/gtk3/candidatepanel.vala | 11 +++++++++--
- 1 file changed, 9 insertions(+), 2 deletions(-)
-
-diff --git a/ui/gtk3/candidatepanel.vala b/ui/gtk3/candidatepanel.vala
-index e22135b..db2d5aa 100644
---- a/ui/gtk3/candidatepanel.vala
-+++ b/ui/gtk3/candidatepanel.vala
-@@ -112,8 +112,15 @@ public class CandidatePanel : Gtk.Box{
- 
-     public void set_preedit_text(IBus.Text? text, uint cursor) {
-         if (text != null) {
--            m_preedit_label.set_text(text.get_text());
--            m_preedit_label.show();
-+            var str = text.get_text();
-+
-+            if (str.length > 0) {
-+                m_preedit_label.set_text(str);
-+                m_preedit_label.show();
-+            } else {
-+                m_preedit_label.set_text("");
-+                m_preedit_label.hide();
-+            }
-         } else {
-             m_preedit_label.set_text("");
-             m_preedit_label.hide();
--- 
-1.8.5.3
-
-From ee4c5ec0a39b5ed4a22fe34307a44f3f9fa1303b Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 6 Jun 2014 17:38:08 +0900
-Subject: [PATCH] Add Polish (qwertz) keymap in simple.xml
-
-BUG=http://code.google.com/p/ibus/issues/detail?id=1716
-TEST=ibus-setup
-
-Review URL: https://codereview.appspot.com/102150045
----
- bus/ibusimpl.c       |  4 ++--
- engine/simple.xml.in | 12 ++++++++++++
- 2 files changed, 14 insertions(+), 2 deletions(-)
-
-diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
-index 97f3602..dd254e2 100644
---- a/bus/ibusimpl.c
-+++ b/bus/ibusimpl.c
-@@ -1450,7 +1450,7 @@ _ibus_set_global_engine (BusIBusImpl           *ibus,
-         g_dbus_method_invocation_return_error (invocation,
-                                                G_DBUS_ERROR,
-                                                G_DBUS_ERROR_FAILED,
--                                               "Can not find engine %s.",
-+                                               "Cannot find engine %s.",
-                                                engine_name);
-         return;
-     }
-@@ -1553,7 +1553,7 @@ _ibus_set_preload_engines (BusIBusImpl     *ibus,
-             g_set_error (error,
-                          G_DBUS_ERROR,
-                          G_DBUS_ERROR_FAILED,
--                         "Can not find engine %s.",
-+                         "Cannot find engine %s.",
-                          names[i]);
-             g_ptr_array_free (array, FALSE);
-             return FALSE;
-diff --git a/engine/simple.xml.in b/engine/simple.xml.in
-index 1b617f8..c16f86a 100644
---- a/engine/simple.xml.in
-+++ b/engine/simple.xml.in
-@@ -477,6 +477,18 @@
-                         <icon>ibus-keyboard</icon>
- 			<rank>99</rank>
- 		</engine>
-+                <engine>
-+                        <name>xkb:pl:qwertz:pol</name>
-+                        <language>pol</language>
-+                        <license>GPL</license>
-+                        <author>Peng Huang &lt;shawn.p.huang@gmail.com&gt;</author>
-+                        <layout>pl</layout>
-+                        <layout_variant>qwertz</layout_variant>
-+                        <longname>Polish (qwertz)</longname>
-+                        <description>Polish (qwertz)</description>
-+                        <icon>ibus-keyboard</icon>
-+                        <rank>1</rank>
-+                </engine>
- 		<engine>
- 			<name>xkb:pt::por</name>
- 			<language>por</language>
--- 
-1.8.5.3
-
-From 9bad0c944162a1700dcb6615aab2a6a9cfd9eff5 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 12 Jun 2014 11:38:43 +0900
-Subject: [PATCH] Fix escape key with Ctrl+Shift+U ISO 14755.
-
-GtkIMContextSimple uses gdk_keymap_get_for_display() to check the readable
-hex codes but IBusEngineSimple ignored it because does not have the display
-argument.
-I added is_hex_keyval() to check the escape key and fix this bug.
-
-BUG=http://code.google.com/p/ibus/issues/detail?id=1715
-TEST=src/libibus.so
-
-Review URL: https://codereview.appspot.com/101160044
----
- src/ibusenginesimple.c | 47 ++++++++++++++++++++++++++++++++++++++---------
- 1 file changed, 38 insertions(+), 9 deletions(-)
-
-diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
-index 8c076ac..300a828 100644
---- a/src/ibusenginesimple.c
-+++ b/src/ibusenginesimple.c
-@@ -693,6 +693,14 @@ no_sequence_matches (IBusEngineSimple *simple,
- }
- 
- static gboolean
-+is_hex_keyval (guint keyval)
-+{
-+  gunichar ch = ibus_keyval_to_unicode (keyval);
-+
-+  return g_unichar_isxdigit (ch);
-+}
-+
-+static gboolean
- ibus_engine_simple_process_key_event (IBusEngine *engine,
-                                       guint       keyval,
-                                       guint       keycode,
-@@ -712,9 +720,6 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
-     while (priv->compose_buffer[n_compose] != 0)
-         n_compose++;
- 
--    if (n_compose >= IBUS_MAX_COMPOSE_LEN)
--        return TRUE;
--
-     if (modifiers & IBUS_RELEASE_MASK) {
-         if (priv->in_hex_sequence &&
-             (keyval == IBUS_KEY_Control_L || keyval == IBUS_KEY_Control_R ||
-@@ -761,7 +766,32 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
-                   keyval == IBUS_KEY_KP_Enter);
-     is_backspace = keyval == IBUS_KEY_BackSpace;
-     is_escape = keyval == IBUS_KEY_Escape;
--    hex_keyval = keyval;
-+    hex_keyval = is_hex_keyval (keyval) ? keyval : 0;
-+
-+    /* gtkimcontextsimple causes a buffer overflow in priv->compose_buffer.
-+     * Add the check code here.
-+     */
-+    if (n_compose >= IBUS_MAX_COMPOSE_LEN) {
-+        if (is_backspace) {
-+            priv->compose_buffer[--n_compose] = 0;
-+        }
-+        else if (is_hex_end) {
-+            /* invalid hex sequence */
-+            // beep_window (event->window);
-+            priv->tentative_match = 0;
-+            priv->in_hex_sequence = FALSE;
-+            priv->compose_buffer[0] = 0;
-+        }
-+        else if (is_escape) {
-+            ibus_engine_simple_reset (engine);
-+            return TRUE;
-+        }
-+
-+        if (have_hex_mods)
-+            ibus_engine_simple_update_preedit_text (simple);
-+
-+        return TRUE;
-+    }
- 
-     /* If we are already in a non-hex sequence, or
-      * this keystroke is not hex modifiers + hex digit, don't filter
-@@ -787,13 +817,12 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
-     /* Handle backspace */
-     if (priv->in_hex_sequence && have_hex_mods && is_backspace) {
-         if (n_compose > 0) {
--        n_compose--;
-+            n_compose--;
-             priv->compose_buffer[n_compose] = 0;
-             check_hex (simple, n_compose);
--    }
--        else {
--        priv->in_hex_sequence = FALSE;
--    }
-+        } else {
-+            priv->in_hex_sequence = FALSE;
-+        }
- 
-         ibus_engine_simple_update_preedit_text (simple);
- 
--- 
-1.8.5.3
-
-From b6afffbd1a06ecf17af009f1de3e513988ecb92e Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 18 Jun 2014 11:42:34 +0900
-Subject: [PATCH] Update ibuscomposetable.h for pt-br.
-
-pt_BR.UTF-8/Compose file is updated:
-http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=e3dc0d1733
-
-TEST=engine/test-compose on pt_BR.UTF-8
-
-Review URL: https://codereview.appspot.com/101330044
----
- src/gencomposetable.c  |  19 +-
- src/ibuscomposetable.h | 608 ++-----------------------------------------------
- 2 files changed, 38 insertions(+), 589 deletions(-)
-
-diff --git a/src/gencomposetable.c b/src/gencomposetable.c
-index bffda07..793a75e 100644
---- a/src/gencomposetable.c
-+++ b/src/gencomposetable.c
-@@ -1,7 +1,7 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* ibus - The Input Bus
-- * Copyright (C) 2013 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2013 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2013-2014 Peng Huang <shawn.p.huang@gmail.com>
-+ * Copyright (C) 2013-2014 Takao Fujiwara <takao.fujiwara1@gmail.com>
-  *
-  * This library is free software; you can redistribute it and/or
-  * modify it under the terms of the GNU Lesser General Public
-@@ -19,6 +19,17 @@
-  * USA
-  */
- 
-+/* This tool converts COMPOSE_FILES[] to ibuscompose.h .
-+ * To update ibuscompose.h:
-+ * # rm ibuscompose.h
-+ * # make ibuscompose.h
-+ *
-+ * If you copy libX11/nls/??/Compose.pre in xorg git HEAD to
-+ * /usr/share/X11/locale/??/Compose , need to convert:
-+ * # sed -e 's/^XCOMM/#/' -e 's|X11_LOCALEDATADIR|/usr/share/X11/locale|'
-+ *   Compose.pre > /usr/share/X11/locale/foo/Compose
-+ */
-+
- #include <glib.h>
- #include <glib/gprintf.h>
- #include <locale.h>
-@@ -36,8 +47,8 @@
- "/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */\n"          \
- "/* vim:set et sts=4: */\n"                                                   \
- "/* ibus - The Input Bus\n"                                                   \
--" * Copyright (C) 2013 Peng Huang <shawn.p.huang@gmail.com>\n"                \
--" * Copyright (C) 2013 Takao Fujiwara <takao.fujiwara1@gmail.com>\n"          \
-+" * Copyright (C) 2013-2014 Peng Huang <shawn.p.huang@gmail.com>\n"           \
-+" * Copyright (C) 2013-2014 Takao Fujiwara <takao.fujiwara1@gmail.com>\n"     \
- " *\n"                                                                        \
- " * This library is free software; you can redistribute it and/or\n"          \
- " * modify it under the terms of the GNU Lesser General Public\n"             \
-diff --git a/src/ibuscomposetable.h b/src/ibuscomposetable.h
-index 2ba3571..22aab48 100644
---- a/src/ibuscomposetable.h
-+++ b/src/ibuscomposetable.h
-@@ -2058,596 +2058,34 @@ static const IBusComposeTable ibus_compose_table_fi_fi = {
- };
- 
- static const guint16 ibus_compose_seqs_pt_br[] = {
--  IBUS_KEY_dead_grave, 0x1F00, 0, 0, 0,
--    0, 0x1F02, /* U1F02 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F01, 0, 0, 0,
--    0, 0x1F03, /* U1F03 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F08, 0, 0, 0,
--    0, 0x1F0A, /* U1F0A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F09, 0, 0, 0,
--    0, 0x1F0B, /* U1F0B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F10, 0, 0, 0,
--    0, 0x1F12, /* U1F12 # GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F11, 0, 0, 0,
--    0, 0x1F13, /* U1F13 # GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F18, 0, 0, 0,
--    0, 0x1F1A, /* U1F1A # GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F19, 0, 0, 0,
--    0, 0x1F1B, /* U1F1B # GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F20, 0, 0, 0,
--    0, 0x1F22, /* U1F22 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F21, 0, 0, 0,
--    0, 0x1F23, /* U1F23 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F28, 0, 0, 0,
--    0, 0x1F2A, /* U1F2A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F29, 0, 0, 0,
--    0, 0x1F2B, /* U1F2B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F30, 0, 0, 0,
--    0, 0x1F32, /* U1F32 # GREEK SMALL LETTER IOTA WITH PSILI AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F31, 0, 0, 0,
--    0, 0x1F33, /* U1F33 # GREEK SMALL LETTER IOTA WITH DASIA AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F38, 0, 0, 0,
--    0, 0x1F3A, /* U1F3A # GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F39, 0, 0, 0,
--    0, 0x1F3B, /* U1F3B # GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F40, 0, 0, 0,
--    0, 0x1F42, /* U1F42 # GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F41, 0, 0, 0,
--    0, 0x1F43, /* U1F43 # GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F48, 0, 0, 0,
--    0, 0x1F4A, /* U1F4A # GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F49, 0, 0, 0,
--    0, 0x1F4B, /* U1F4B # GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F50, 0, 0, 0,
--    0, 0x1F52, /* U1F52 # GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F51, 0, 0, 0,
--    0, 0x1F53, /* U1F53 # GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F59, 0, 0, 0,
--    0, 0x1F5B, /* U1F5B # GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F60, 0, 0, 0,
--    0, 0x1F62, /* U1F62 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F61, 0, 0, 0,
--    0, 0x1F63, /* U1F63 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F68, 0, 0, 0,
--    0, 0x1F6A, /* U1F6A # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA */
--  IBUS_KEY_dead_grave, 0x1F69, 0, 0, 0,
--    0, 0x1F6B, /* U1F6B # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA */
--  IBUS_KEY_dead_acute, IBUS_KEY_C, 0, 0, 0,
--    0, 0x00C7, /* Ccedilla # LATIN CAPITAL LETTER C WITH CEDILLA */
--  IBUS_KEY_dead_acute, IBUS_KEY_c, 0, 0, 0,
--    0, 0x00E7, /* ccedilla # LATIN SMALL LETTER C WITH CEDILLA */
--  IBUS_KEY_dead_acute, 0x1F00, 0, 0, 0,
--    0, 0x1F04, /* U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F01, 0, 0, 0,
--    0, 0x1F05, /* U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F08, 0, 0, 0,
--    0, 0x1F0C, /* U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F09, 0, 0, 0,
--    0, 0x1F0D, /* U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F10, 0, 0, 0,
--    0, 0x1F14, /* U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F11, 0, 0, 0,
--    0, 0x1F15, /* U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F18, 0, 0, 0,
--    0, 0x1F1C, /* U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F19, 0, 0, 0,
--    0, 0x1F1D, /* U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F20, 0, 0, 0,
--    0, 0x1F24, /* U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F21, 0, 0, 0,
--    0, 0x1F25, /* U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F28, 0, 0, 0,
--    0, 0x1F2C, /* U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F29, 0, 0, 0,
--    0, 0x1F2D, /* U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F30, 0, 0, 0,
--    0, 0x1F34, /* U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F31, 0, 0, 0,
--    0, 0x1F35, /* U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F38, 0, 0, 0,
--    0, 0x1F3C, /* U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F39, 0, 0, 0,
--    0, 0x1F3D, /* U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F40, 0, 0, 0,
--    0, 0x1F44, /* U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F41, 0, 0, 0,
--    0, 0x1F45, /* U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F48, 0, 0, 0,
--    0, 0x1F4C, /* U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F49, 0, 0, 0,
--    0, 0x1F4D, /* U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F50, 0, 0, 0,
--    0, 0x1F54, /* U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F51, 0, 0, 0,
--    0, 0x1F55, /* U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F59, 0, 0, 0,
--    0, 0x1F5D, /* U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F60, 0, 0, 0,
--    0, 0x1F64, /* U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F61, 0, 0, 0,
--    0, 0x1F65, /* U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F68, 0, 0, 0,
--    0, 0x1F6C, /* U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA */
--  IBUS_KEY_dead_acute, 0x1F69, 0, 0, 0,
--    0, 0x1F6D, /* U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA */
--  IBUS_KEY_dead_circumflex, 0x1EA0, 0, 0, 0,
--    0, 0x1EAC, /* U1EAC # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW */
--  IBUS_KEY_dead_circumflex, 0x1EA1, 0, 0, 0,
--    0, 0x1EAD, /* U1EAD # LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW */
--  IBUS_KEY_dead_circumflex, 0x1EB8, 0, 0, 0,
--    0, 0x1EC6, /* U1EC6 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW */
--  IBUS_KEY_dead_circumflex, 0x1EB9, 0, 0, 0,
--    0, 0x1EC7, /* U1EC7 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW */
--  IBUS_KEY_dead_circumflex, 0x1ECC, 0, 0, 0,
--    0, 0x1ED8, /* U1ED8 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW */
--  IBUS_KEY_dead_circumflex, 0x1ECD, 0, 0, 0,
--    0, 0x1ED9, /* U1ED9 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW */
--  IBUS_KEY_dead_macron, 0x01EA, 0, 0, 0,
--    0, 0x01EC, /* U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON */
--  IBUS_KEY_dead_macron, 0x01EB, 0, 0, 0,
--    0, 0x01ED, /* U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON */
--  IBUS_KEY_dead_macron, 0x0226, 0, 0, 0,
--    0, 0x01E0, /* U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON */
--  IBUS_KEY_dead_macron, 0x0227, 0, 0, 0,
--    0, 0x01E1, /* U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON */
--  IBUS_KEY_dead_macron, 0x022E, 0, 0, 0,
--    0, 0x0230, /* U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON */
--  IBUS_KEY_dead_macron, 0x022F, 0, 0, 0,
--    0, 0x0231, /* U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON */
--  IBUS_KEY_dead_macron, 0x1E36, 0, 0, 0,
--    0, 0x1E38, /* U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON */
--  IBUS_KEY_dead_macron, 0x1E37, 0, 0, 0,
--    0, 0x1E39, /* U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON */
--  IBUS_KEY_dead_macron, 0x1E5A, 0, 0, 0,
--    0, 0x1E5C, /* U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON */
--  IBUS_KEY_dead_macron, 0x1E5B, 0, 0, 0,
--    0, 0x1E5D, /* U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON */
--  IBUS_KEY_dead_macron, IBUS_KEY_dead_diaeresis, IBUS_KEY_U, 0, 0,
--    0, 0x01D5, /* U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON */
--  IBUS_KEY_dead_macron, IBUS_KEY_dead_diaeresis, IBUS_KEY_u, 0, 0,
--    0, 0x01D6, /* U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON */
--  IBUS_KEY_dead_breve, 0x0228, 0, 0, 0,
--    0, 0x1E1C, /* U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE */
--  IBUS_KEY_dead_breve, 0x0229, 0, 0, 0,
--    0, 0x1E1D, /* U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE */
--  IBUS_KEY_dead_breve, 0x1EA0, 0, 0, 0,
--    0, 0x1EB6, /* U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW */
--  IBUS_KEY_dead_breve, 0x1EA1, 0, 0, 0,
--    0, 0x1EB7, /* U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW */
--  IBUS_KEY_dead_abovedot, 0x017F, 0, 0, 0,
--    0, 0x1E9B, /* U1E9B # LATIN SMALL LETTER LONG S WITH DOT ABOVE */
--  IBUS_KEY_dead_abovedot, 0x1E62, 0, 0, 0,
--    0, 0x1E68, /* U1E68 # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE */
--  IBUS_KEY_dead_abovedot, 0x1E63, 0, 0, 0,
--    0, 0x1E69, /* U1E69 # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE */
--  IBUS_KEY_dead_diaeresis, 0x04D8, 0, 0, 0,
--    0, 0x04DA, /* U04DA # CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS */
--  IBUS_KEY_dead_diaeresis, 0x04D9, 0, 0, 0,
--    0, 0x04DB, /* U04DB # CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS */
--  IBUS_KEY_dead_diaeresis, 0x04E8, 0, 0, 0,
--    0, 0x04EA, /* U04EA # CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS */
--  IBUS_KEY_dead_diaeresis, 0x04E9, 0, 0, 0,
--    0, 0x04EB, /* U04EB # CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS */
--  IBUS_KEY_dead_diaeresis, IBUS_KEY_dead_macron, IBUS_KEY_U, 0, 0,
--    0, 0x1E7A, /* U1E7A # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS */
--  IBUS_KEY_dead_diaeresis, IBUS_KEY_dead_macron, IBUS_KEY_u, 0, 0,
--    0, 0x1E7B, /* U1E7B # LATIN SMALL LETTER U WITH MACRON AND DIAERESIS */
--  IBUS_KEY_dead_iota, 0x1F00, 0, 0, 0,
--    0, 0x1F80, /* U1F80 # GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F01, 0, 0, 0,
--    0, 0x1F81, /* U1F81 # GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F02, 0, 0, 0,
--    0, 0x1F82, /* U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F03, 0, 0, 0,
--    0, 0x1F83, /* U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F04, 0, 0, 0,
--    0, 0x1F84, /* U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F05, 0, 0, 0,
--    0, 0x1F85, /* U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F06, 0, 0, 0,
--    0, 0x1F86, /* U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F07, 0, 0, 0,
--    0, 0x1F87, /* U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F08, 0, 0, 0,
--    0, 0x1F88, /* U1F88 # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F09, 0, 0, 0,
--    0, 0x1F89, /* U1F89 # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F0A, 0, 0, 0,
--    0, 0x1F8A, /* U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F0B, 0, 0, 0,
--    0, 0x1F8B, /* U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F0C, 0, 0, 0,
--    0, 0x1F8C, /* U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F0D, 0, 0, 0,
--    0, 0x1F8D, /* U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F0E, 0, 0, 0,
--    0, 0x1F8E, /* U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F0F, 0, 0, 0,
--    0, 0x1F8F, /* U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F20, 0, 0, 0,
--    0, 0x1F90, /* U1F90 # GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F21, 0, 0, 0,
--    0, 0x1F91, /* U1F91 # GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F22, 0, 0, 0,
--    0, 0x1F92, /* U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F23, 0, 0, 0,
--    0, 0x1F93, /* U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F24, 0, 0, 0,
--    0, 0x1F94, /* U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F25, 0, 0, 0,
--    0, 0x1F95, /* U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F26, 0, 0, 0,
--    0, 0x1F96, /* U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F27, 0, 0, 0,
--    0, 0x1F97, /* U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F28, 0, 0, 0,
--    0, 0x1F98, /* U1F98 # GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F29, 0, 0, 0,
--    0, 0x1F99, /* U1F99 # GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F2A, 0, 0, 0,
--    0, 0x1F9A, /* U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F2B, 0, 0, 0,
--    0, 0x1F9B, /* U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F2C, 0, 0, 0,
--    0, 0x1F9C, /* U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F2D, 0, 0, 0,
--    0, 0x1F9D, /* U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F2E, 0, 0, 0,
--    0, 0x1F9E, /* U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F2F, 0, 0, 0,
--    0, 0x1F9F, /* U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F60, 0, 0, 0,
--    0, 0x1FA0, /* U1FA0 # GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F61, 0, 0, 0,
--    0, 0x1FA1, /* U1FA1 # GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F62, 0, 0, 0,
--    0, 0x1FA2, /* U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F63, 0, 0, 0,
--    0, 0x1FA3, /* U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F64, 0, 0, 0,
--    0, 0x1FA4, /* U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F65, 0, 0, 0,
--    0, 0x1FA5, /* U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F66, 0, 0, 0,
--    0, 0x1FA6, /* U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F67, 0, 0, 0,
--    0, 0x1FA7, /* U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F68, 0, 0, 0,
--    0, 0x1FA8, /* U1FA8 # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F69, 0, 0, 0,
--    0, 0x1FA9, /* U1FA9 # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F6A, 0, 0, 0,
--    0, 0x1FAA, /* U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F6B, 0, 0, 0,
--    0, 0x1FAB, /* U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F6C, 0, 0, 0,
--    0, 0x1FAC, /* U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F6D, 0, 0, 0,
--    0, 0x1FAD, /* U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F6E, 0, 0, 0,
--    0, 0x1FAE, /* U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F6F, 0, 0, 0,
--    0, 0x1FAF, /* U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F70, 0, 0, 0,
--    0, 0x1FB2, /* U1FB2 # GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F74, 0, 0, 0,
--    0, 0x1FC2, /* U1FC2 # GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1F7C, 0, 0, 0,
--    0, 0x1FF2, /* U1FF2 # GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1FB6, 0, 0, 0,
--    0, 0x1FB7, /* U1FB7 # GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1FC6, 0, 0, 0,
--    0, 0x1FC7, /* U1FC7 # GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, 0x1FF6, 0, 0, 0,
--    0, 0x1FF7, /* U1FF7 # GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_grave, 0x1F00, 0, 0,
--    0, 0x1F82, /* U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_grave, 0x1F01, 0, 0,
--    0, 0x1F83, /* U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_grave, 0x1F08, 0, 0,
--    0, 0x1F8A, /* U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_grave, 0x1F09, 0, 0,
--    0, 0x1F8B, /* U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_grave, 0x1F20, 0, 0,
--    0, 0x1F92, /* U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_grave, 0x1F21, 0, 0,
--    0, 0x1F93, /* U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_grave, 0x1F28, 0, 0,
--    0, 0x1F9A, /* U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_grave, 0x1F29, 0, 0,
--    0, 0x1F9B, /* U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_grave, 0x1F60, 0, 0,
--    0, 0x1FA2, /* U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_grave, 0x1F61, 0, 0,
--    0, 0x1FA3, /* U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_grave, 0x1F68, 0, 0,
--    0, 0x1FAA, /* U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_grave, 0x1F69, 0, 0,
--    0, 0x1FAB, /* U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_acute, 0x1F00, 0, 0,
--    0, 0x1F84, /* U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_acute, 0x1F01, 0, 0,
--    0, 0x1F85, /* U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_acute, 0x1F08, 0, 0,
--    0, 0x1F8C, /* U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_acute, 0x1F09, 0, 0,
--    0, 0x1F8D, /* U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_acute, 0x1F20, 0, 0,
--    0, 0x1F94, /* U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_acute, 0x1F21, 0, 0,
--    0, 0x1F95, /* U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_acute, 0x1F28, 0, 0,
--    0, 0x1F9C, /* U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_acute, 0x1F29, 0, 0,
--    0, 0x1F9D, /* U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_acute, 0x1F60, 0, 0,
--    0, 0x1FA4, /* U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_acute, 0x1F61, 0, 0,
--    0, 0x1FA5, /* U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_acute, 0x1F68, 0, 0,
--    0, 0x1FAC, /* U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_iota, IBUS_KEY_dead_acute, 0x1F69, 0, 0,
--    0, 0x1FAD, /* U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI */
--  IBUS_KEY_dead_voiced_sound, 0x3046, 0, 0, 0,
--    0, 0x3094, /* U3094 # HIRAGANA LETTER VU */
--  IBUS_KEY_dead_voiced_sound, 0x304B, 0, 0, 0,
--    0, 0x304C, /* U304C # HIRAGANA LETTER GA */
--  IBUS_KEY_dead_voiced_sound, 0x304D, 0, 0, 0,
--    0, 0x304E, /* U304E # HIRAGANA LETTER GI */
--  IBUS_KEY_dead_voiced_sound, 0x304F, 0, 0, 0,
--    0, 0x3050, /* U3050 # HIRAGANA LETTER GU */
--  IBUS_KEY_dead_voiced_sound, 0x3051, 0, 0, 0,
--    0, 0x3052, /* U3052 # HIRAGANA LETTER GE */
--  IBUS_KEY_dead_voiced_sound, 0x3053, 0, 0, 0,
--    0, 0x3054, /* U3054 # HIRAGANA LETTER GO */
--  IBUS_KEY_dead_voiced_sound, 0x3055, 0, 0, 0,
--    0, 0x3056, /* U3056 # HIRAGANA LETTER ZA */
--  IBUS_KEY_dead_voiced_sound, 0x3057, 0, 0, 0,
--    0, 0x3058, /* U3058 # HIRAGANA LETTER ZI */
--  IBUS_KEY_dead_voiced_sound, 0x3059, 0, 0, 0,
--    0, 0x305A, /* U305A # HIRAGANA LETTER ZU */
--  IBUS_KEY_dead_voiced_sound, 0x305B, 0, 0, 0,
--    0, 0x305C, /* U305C # HIRAGANA LETTER ZE */
--  IBUS_KEY_dead_voiced_sound, 0x305D, 0, 0, 0,
--    0, 0x305E, /* U305E # HIRAGANA LETTER ZO */
--  IBUS_KEY_dead_voiced_sound, 0x305F, 0, 0, 0,
--    0, 0x3060, /* U3060 # HIRAGANA LETTER DA */
--  IBUS_KEY_dead_voiced_sound, 0x3061, 0, 0, 0,
--    0, 0x3062, /* U3062 # HIRAGANA LETTER DI */
--  IBUS_KEY_dead_voiced_sound, 0x3064, 0, 0, 0,
--    0, 0x3065, /* U3065 # HIRAGANA LETTER DU */
--  IBUS_KEY_dead_voiced_sound, 0x3066, 0, 0, 0,
--    0, 0x3067, /* U3067 # HIRAGANA LETTER DE */
--  IBUS_KEY_dead_voiced_sound, 0x3068, 0, 0, 0,
--    0, 0x3069, /* U3069 # HIRAGANA LETTER DO */
--  IBUS_KEY_dead_voiced_sound, 0x306F, 0, 0, 0,
--    0, 0x3070, /* U3070 # HIRAGANA LETTER BA */
--  IBUS_KEY_dead_voiced_sound, 0x3072, 0, 0, 0,
--    0, 0x3073, /* U3073 # HIRAGANA LETTER BI */
--  IBUS_KEY_dead_voiced_sound, 0x3075, 0, 0, 0,
--    0, 0x3076, /* U3076 # HIRAGANA LETTER BU */
--  IBUS_KEY_dead_voiced_sound, 0x3078, 0, 0, 0,
--    0, 0x3079, /* U3079 # HIRAGANA LETTER BE */
--  IBUS_KEY_dead_voiced_sound, 0x307B, 0, 0, 0,
--    0, 0x307C, /* U307C # HIRAGANA LETTER BO */
--  IBUS_KEY_dead_voiced_sound, 0x309D, 0, 0, 0,
--    0, 0x309E, /* U309E # HIRAGANA VOICED ITERATION MARK */
--  IBUS_KEY_dead_voiced_sound, 0x30F0, 0, 0, 0,
--    0, 0x30F8, /* U30F8 # KATAKANA LETTER VI */
--  IBUS_KEY_dead_voiced_sound, 0x30F1, 0, 0, 0,
--    0, 0x30F9, /* U30F9 # KATAKANA LETTER VE */
--  IBUS_KEY_dead_voiced_sound, 0x30FD, 0, 0, 0,
--    0, 0x30FE, /* U30FE # KATAKANA VOICED ITERATION MARK */
--  IBUS_KEY_dead_semivoiced_sound, 0x306F, 0, 0, 0,
--    0, 0x3071, /* U3071 # HIRAGANA LETTER PA */
--  IBUS_KEY_dead_semivoiced_sound, 0x3072, 0, 0, 0,
--    0, 0x3074, /* U3074 # HIRAGANA LETTER PI */
--  IBUS_KEY_dead_semivoiced_sound, 0x3075, 0, 0, 0,
--    0, 0x3077, /* U3077 # HIRAGANA LETTER PU */
--  IBUS_KEY_dead_semivoiced_sound, 0x3078, 0, 0, 0,
--    0, 0x307A, /* U307A # HIRAGANA LETTER PE */
--  IBUS_KEY_dead_semivoiced_sound, 0x307B, 0, 0, 0,
--    0, 0x307D, /* U307D # HIRAGANA LETTER PO */
--  IBUS_KEY_dead_doublegrave, IBUS_KEY_A, 0, 0, 0,
--    0, 0x0200, /* U0200 # LATIN CAPITAL LETTER A WITH DOUBLE GRAVE */
--  IBUS_KEY_dead_doublegrave, IBUS_KEY_E, 0, 0, 0,
--    0, 0x0204, /* U0204 # LATIN CAPITAL LETTER E WITH DOUBLE GRAVE */
--  IBUS_KEY_dead_doublegrave, IBUS_KEY_I, 0, 0, 0,
--    0, 0x0208, /* U0208 # LATIN CAPITAL LETTER I WITH DOUBLE GRAVE */
--  IBUS_KEY_dead_doublegrave, IBUS_KEY_O, 0, 0, 0,
--    0, 0x020C, /* U020C # LATIN CAPITAL LETTER O WITH DOUBLE GRAVE */
--  IBUS_KEY_dead_doublegrave, IBUS_KEY_R, 0, 0, 0,
--    0, 0x0210, /* U0210 # LATIN CAPITAL LETTER R WITH DOUBLE GRAVE */
--  IBUS_KEY_dead_doublegrave, IBUS_KEY_U, 0, 0, 0,
--    0, 0x0214, /* U0214 # LATIN CAPITAL LETTER U WITH DOUBLE GRAVE */
--  IBUS_KEY_dead_doublegrave, IBUS_KEY_a, 0, 0, 0,
--    0, 0x0201, /* U0201 # LATIN SMALL LETTER A WITH DOUBLE GRAVE */
--  IBUS_KEY_dead_doublegrave, IBUS_KEY_e, 0, 0, 0,
--    0, 0x0205, /* U0205 # LATIN SMALL LETTER E WITH DOUBLE GRAVE */
--  IBUS_KEY_dead_doublegrave, IBUS_KEY_i, 0, 0, 0,
--    0, 0x0209, /* U0209 # LATIN SMALL LETTER I WITH DOUBLE GRAVE */
--  IBUS_KEY_dead_doublegrave, IBUS_KEY_o, 0, 0, 0,
--    0, 0x020D, /* U020D # LATIN SMALL LETTER O WITH DOUBLE GRAVE */
--  IBUS_KEY_dead_doublegrave, IBUS_KEY_r, 0, 0, 0,
--    0, 0x0211, /* U0211 # LATIN SMALL LETTER R WITH DOUBLE GRAVE */
--  IBUS_KEY_dead_doublegrave, IBUS_KEY_u, 0, 0, 0,
--    0, 0x0215, /* U0215 # LATIN SMALL LETTER U WITH DOUBLE GRAVE */
--  IBUS_KEY_dead_doublegrave, 0x0474, 0, 0, 0,
--    0, 0x0476, /* U0476 # CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT */
--  IBUS_KEY_dead_doublegrave, 0x0475, 0, 0, 0,
--    0, 0x0477, /* U0477 # CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT */
--  IBUS_KEY_dead_belowring, IBUS_KEY_A, 0, 0, 0,
--    0, 0x1E00, /* U1E00 # LATIN CAPITAL LETTER A WITH RING BELOW */
--  IBUS_KEY_dead_belowring, IBUS_KEY_a, 0, 0, 0,
--    0, 0x1E01, /* U1E01 # LATIN SMALL LETTER A WITH RING BELOW */
--  IBUS_KEY_dead_belowmacron, IBUS_KEY_B, 0, 0, 0,
--    0, 0x1E06, /* U1E06 # LATIN CAPITAL LETTER B WITH LINE BELOW */
--  IBUS_KEY_dead_belowmacron, IBUS_KEY_D, 0, 0, 0,
--    0, 0x1E0E, /* U1E0E # LATIN CAPITAL LETTER D WITH LINE BELOW */
--  IBUS_KEY_dead_belowmacron, IBUS_KEY_K, 0, 0, 0,
--    0, 0x1E34, /* U1E34 # LATIN CAPITAL LETTER K WITH LINE BELOW */
--  IBUS_KEY_dead_belowmacron, IBUS_KEY_L, 0, 0, 0,
--    0, 0x1E3A, /* U1E3A # LATIN CAPITAL LETTER L WITH LINE BELOW */
--  IBUS_KEY_dead_belowmacron, IBUS_KEY_N, 0, 0, 0,
--    0, 0x1E48, /* U1E48 # LATIN CAPITAL LETTER N WITH LINE BELOW */
--  IBUS_KEY_dead_belowmacron, IBUS_KEY_R, 0, 0, 0,
--    0, 0x1E5E, /* U1E5E # LATIN CAPITAL LETTER R WITH LINE BELOW */
--  IBUS_KEY_dead_belowmacron, IBUS_KEY_T, 0, 0, 0,
--    0, 0x1E6E, /* U1E6E # LATIN CAPITAL LETTER T WITH LINE BELOW */
--  IBUS_KEY_dead_belowmacron, IBUS_KEY_Z, 0, 0, 0,
--    0, 0x1E94, /* U1E94 # LATIN CAPITAL LETTER Z WITH LINE BELOW */
--  IBUS_KEY_dead_belowmacron, IBUS_KEY_b, 0, 0, 0,
--    0, 0x1E07, /* U1E07 # LATIN SMALL LETTER B WITH LINE BELOW */
--  IBUS_KEY_dead_belowmacron, IBUS_KEY_d, 0, 0, 0,
--    0, 0x1E0F, /* U1E0F # LATIN SMALL LETTER D WITH LINE BELOW */
--  IBUS_KEY_dead_belowmacron, IBUS_KEY_h, 0, 0, 0,
--    0, 0x1E96, /* U1E96 # LATIN SMALL LETTER H WITH LINE BELOW */
--  IBUS_KEY_dead_belowmacron, IBUS_KEY_k, 0, 0, 0,
--    0, 0x1E35, /* U1E35 # LATIN SMALL LETTER K WITH LINE BELOW */
--  IBUS_KEY_dead_belowmacron, IBUS_KEY_l, 0, 0, 0,
--    0, 0x1E3B, /* U1E3B # LATIN SMALL LETTER L WITH LINE BELOW */
--  IBUS_KEY_dead_belowmacron, IBUS_KEY_n, 0, 0, 0,
--    0, 0x1E49, /* U1E49 # LATIN SMALL LETTER N WITH LINE BELOW */
--  IBUS_KEY_dead_belowmacron, IBUS_KEY_r, 0, 0, 0,
--    0, 0x1E5F, /* U1E5F # LATIN SMALL LETTER R WITH LINE BELOW */
--  IBUS_KEY_dead_belowmacron, IBUS_KEY_t, 0, 0, 0,
--    0, 0x1E6F, /* U1E6F # LATIN SMALL LETTER T WITH LINE BELOW */
--  IBUS_KEY_dead_belowmacron, IBUS_KEY_z, 0, 0, 0,
--    0, 0x1E95, /* U1E95 # LATIN SMALL LETTER Z WITH LINE BELOW */
--  IBUS_KEY_dead_belowcircumflex, IBUS_KEY_D, 0, 0, 0,
--    0, 0x1E12, /* U1E12 # LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW */
--  IBUS_KEY_dead_belowcircumflex, IBUS_KEY_E, 0, 0, 0,
--    0, 0x1E18, /* U1E18 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW */
--  IBUS_KEY_dead_belowcircumflex, IBUS_KEY_L, 0, 0, 0,
--    0, 0x1E3C, /* U1E3C # LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW */
--  IBUS_KEY_dead_belowcircumflex, IBUS_KEY_N, 0, 0, 0,
--    0, 0x1E4A, /* U1E4A # LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW */
--  IBUS_KEY_dead_belowcircumflex, IBUS_KEY_T, 0, 0, 0,
--    0, 0x1E70, /* U1E70 # LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW */
--  IBUS_KEY_dead_belowcircumflex, IBUS_KEY_U, 0, 0, 0,
--    0, 0x1E76, /* U1E76 # LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW */
--  IBUS_KEY_dead_belowcircumflex, IBUS_KEY_d, 0, 0, 0,
--    0, 0x1E13, /* U1E13 # LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW */
--  IBUS_KEY_dead_belowcircumflex, IBUS_KEY_e, 0, 0, 0,
--    0, 0x1E19, /* U1E19 # LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW */
--  IBUS_KEY_dead_belowcircumflex, IBUS_KEY_l, 0, 0, 0,
--    0, 0x1E3D, /* U1E3D # LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW */
--  IBUS_KEY_dead_belowcircumflex, IBUS_KEY_n, 0, 0, 0,
--    0, 0x1E4B, /* U1E4B # LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW */
--  IBUS_KEY_dead_belowcircumflex, IBUS_KEY_t, 0, 0, 0,
--    0, 0x1E71, /* U1E71 # LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW */
--  IBUS_KEY_dead_belowcircumflex, IBUS_KEY_u, 0, 0, 0,
--    0, 0x1E77, /* U1E77 # LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW */
--  IBUS_KEY_dead_belowtilde, IBUS_KEY_E, 0, 0, 0,
--    0, 0x1E1A, /* U1E1A # LATIN CAPITAL LETTER E WITH TILDE BELOW */
--  IBUS_KEY_dead_belowtilde, IBUS_KEY_I, 0, 0, 0,
--    0, 0x1E2C, /* U1E2C # LATIN CAPITAL LETTER I WITH TILDE BELOW */
--  IBUS_KEY_dead_belowtilde, IBUS_KEY_U, 0, 0, 0,
--    0, 0x1E74, /* U1E74 # LATIN CAPITAL LETTER U WITH TILDE BELOW */
--  IBUS_KEY_dead_belowtilde, IBUS_KEY_e, 0, 0, 0,
--    0, 0x1E1B, /* U1E1B # LATIN SMALL LETTER E WITH TILDE BELOW */
--  IBUS_KEY_dead_belowtilde, IBUS_KEY_i, 0, 0, 0,
--    0, 0x1E2D, /* U1E2D # LATIN SMALL LETTER I WITH TILDE BELOW */
--  IBUS_KEY_dead_belowtilde, IBUS_KEY_u, 0, 0, 0,
--    0, 0x1E75, /* U1E75 # LATIN SMALL LETTER U WITH TILDE BELOW */
--  IBUS_KEY_dead_belowbreve, IBUS_KEY_H, 0, 0, 0,
--    0, 0x1E2A, /* U1E2A # LATIN CAPITAL LETTER H WITH BREVE BELOW */
--  IBUS_KEY_dead_belowbreve, IBUS_KEY_h, 0, 0, 0,
--    0, 0x1E2B, /* U1E2B # LATIN SMALL LETTER H WITH BREVE BELOW */
--  IBUS_KEY_dead_belowdiaeresis, IBUS_KEY_U, 0, 0, 0,
--    0, 0x1E72, /* U1E72 # LATIN CAPITAL LETTER U WITH DIAERESIS BELOW */
--  IBUS_KEY_dead_belowdiaeresis, IBUS_KEY_u, 0, 0, 0,
--    0, 0x1E73, /* U1E73 # LATIN SMALL LETTER U WITH DIAERESIS BELOW */
--  IBUS_KEY_dead_invertedbreve, IBUS_KEY_A, 0, 0, 0,
--    0, 0x0202, /* U0202 # LATIN CAPITAL LETTER A WITH INVERTED BREVE */
--  IBUS_KEY_dead_invertedbreve, IBUS_KEY_E, 0, 0, 0,
--    0, 0x0206, /* U0206 # LATIN CAPITAL LETTER E WITH INVERTED BREVE */
--  IBUS_KEY_dead_invertedbreve, IBUS_KEY_I, 0, 0, 0,
--    0, 0x020A, /* U020A # LATIN CAPITAL LETTER I WITH INVERTED BREVE */
--  IBUS_KEY_dead_invertedbreve, IBUS_KEY_O, 0, 0, 0,
--    0, 0x020E, /* U020E # LATIN CAPITAL LETTER O WITH INVERTED BREVE */
--  IBUS_KEY_dead_invertedbreve, IBUS_KEY_R, 0, 0, 0,
--    0, 0x0212, /* U0212 # LATIN CAPITAL LETTER R WITH INVERTED BREVE */
--  IBUS_KEY_dead_invertedbreve, IBUS_KEY_U, 0, 0, 0,
--    0, 0x0216, /* U0216 # LATIN CAPITAL LETTER U WITH INVERTED BREVE */
--  IBUS_KEY_dead_invertedbreve, IBUS_KEY_a, 0, 0, 0,
--    0, 0x0203, /* U0203 # LATIN SMALL LETTER A WITH INVERTED BREVE */
--  IBUS_KEY_dead_invertedbreve, IBUS_KEY_e, 0, 0, 0,
--    0, 0x0207, /* U0207 # LATIN SMALL LETTER E WITH INVERTED BREVE */
--  IBUS_KEY_dead_invertedbreve, IBUS_KEY_i, 0, 0, 0,
--    0, 0x020B, /* U020B # LATIN SMALL LETTER I WITH INVERTED BREVE */
--  IBUS_KEY_dead_invertedbreve, IBUS_KEY_o, 0, 0, 0,
--    0, 0x020F, /* U020F # LATIN SMALL LETTER O WITH INVERTED BREVE */
--  IBUS_KEY_dead_invertedbreve, IBUS_KEY_r, 0, 0, 0,
--    0, 0x0213, /* U0213 # LATIN SMALL LETTER R WITH INVERTED BREVE */
--  IBUS_KEY_dead_invertedbreve, IBUS_KEY_u, 0, 0, 0,
--    0, 0x0217, /* U0217 # LATIN SMALL LETTER U WITH INVERTED BREVE */
--  IBUS_KEY_dead_belowcomma, IBUS_KEY_S, 0, 0, 0,
--    0, 0x0218, /* U0218 # LATIN CAPITAL LETTER S WITH COMMA BELOW */
--  IBUS_KEY_dead_belowcomma, IBUS_KEY_T, 0, 0, 0,
--    0, 0x021A, /* U021A # LATIN CAPITAL LETTER T WITH COMMA BELOW */
--  IBUS_KEY_dead_belowcomma, IBUS_KEY_s, 0, 0, 0,
--    0, 0x0219, /* U0219 # LATIN SMALL LETTER S WITH COMMA BELOW */
--  IBUS_KEY_dead_belowcomma, IBUS_KEY_t, 0, 0, 0,
--    0, 0x021B, /* U021B # LATIN SMALL LETTER T WITH COMMA BELOW */
--  IBUS_KEY_Multi_key, IBUS_KEY_quotedbl, IBUS_KEY_slash, 0, 0,
--    0, 0x301E, /* U301e # DOUBLE PRIME QUOTATION MARK */
--  IBUS_KEY_Multi_key, IBUS_KEY_quotedbl, IBUS_KEY_backslash, 0, 0,
--    0, 0x301D, /* U301d # REVERSED DOUBLE PRIME QUOTATION MARK */
--  IBUS_KEY_Multi_key, IBUS_KEY_apostrophe, 0x03D2, 0, 0,
--    0, 0x03D3, /* U03D3 # GREEK UPSILON WITH ACUTE AND HOOK SYMBOL */
--  IBUS_KEY_Multi_key, IBUS_KEY_parenleft, IBUS_KEY_5, IBUS_KEY_0, IBUS_KEY_parenright,
--    0, 0x32BF, /* U32BF # CIRCLED NUMBER FIFTY */
--  IBUS_KEY_Multi_key, IBUS_KEY_parenleft, IBUS_KEY_KP_5, IBUS_KEY_0, IBUS_KEY_parenright,
--    0, 0x32BF, /* U32BF # CIRCLED NUMBER FIFTY */
--  IBUS_KEY_Multi_key, IBUS_KEY_comma, IBUS_KEY_E, 0, 0,
--    0, 0x0228, /* U0228 # LATIN CAPITAL LETTER E WITH CEDILLA */
--  IBUS_KEY_Multi_key, IBUS_KEY_comma, IBUS_KEY_e, 0, 0,
--    0, 0x0229, /* U0229 # LATIN SMALL LETTER E WITH CEDILLA */
--  IBUS_KEY_Multi_key, IBUS_KEY_period, 0x1E63, 0, 0,
--    0, 0x1E69, /* U1E69 # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE */
--  IBUS_KEY_Multi_key, IBUS_KEY_question, IBUS_KEY_exclam, 0, 0,
--    0, 0x203D, /* U203D # INTERROBANG */
--  IBUS_KEY_Multi_key, IBUS_KEY_L, IBUS_KEY_equal, 0, 0,
--    0, 0x20A4, /* U20a4 # LIRA SIGN */
--  IBUS_KEY_Multi_key, IBUS_KEY_U, IBUS_KEY_comma, IBUS_KEY_E, 0,
--    0, 0x1E1C, /* U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE */
--  IBUS_KEY_Multi_key, IBUS_KEY_U, IBUS_KEY_comma, IBUS_KEY_e, 0,
--    0, 0x1E1D, /* U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE */
--  IBUS_KEY_Multi_key, IBUS_KEY_d, IBUS_KEY_minus, 0, 0,
--    0, 0x20AB, /* U20ab # DONG SIGN */
--  IBUS_KEY_Multi_key, IBUS_KEY_e, IBUS_KEY_e, 0, 0,
-+  IBUS_KEY_dead_acute, IBUS_KEY_C, 0, 0,
-+    0, 0x00C7, /* Ccedilla	# LATIN CAPITAL LETTER C WITH CEDILLA */
-+  IBUS_KEY_dead_acute, IBUS_KEY_c, 0, 0,
-+    0, 0x00E7, /* ccedilla	# LATIN SMALL LETTER C WITH CEDILLA */
-+  IBUS_KEY_Multi_key, IBUS_KEY_quotedbl, IBUS_KEY_slash, 0,
-+    0, 0x301E, /* U301e	# DOUBLE PRIME QUOTATION MARK */
-+  IBUS_KEY_Multi_key, IBUS_KEY_quotedbl, IBUS_KEY_backslash, 0,
-+    0, 0x301D, /* U301d	# REVERSED DOUBLE PRIME QUOTATION MARK */
-+  IBUS_KEY_Multi_key, IBUS_KEY_apostrophe, 0x03D2, 0,
-+    0, 0x03D3, /* U03D3	# GREEK UPSILON WITH ACUTE AND HOOK SYMBOL */
-+  IBUS_KEY_Multi_key, IBUS_KEY_comma, IBUS_KEY_E, 0,
-+    0, 0x0228, /* U0228	# LATIN CAPITAL LETTER E WITH CEDILLA */
-+  IBUS_KEY_Multi_key, IBUS_KEY_comma, IBUS_KEY_e, 0,
-+    0, 0x0229, /* U0229	# LATIN SMALL LETTER E WITH CEDILLA */
-+  IBUS_KEY_Multi_key, IBUS_KEY_U, IBUS_KEY_comma, IBUS_KEY_E,
-+    0, 0x1E1C, /* U1E1C	# LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE */
-+  IBUS_KEY_Multi_key, IBUS_KEY_U, IBUS_KEY_comma, IBUS_KEY_e,
-+    0, 0x1E1D, /* U1E1D	# LATIN SMALL LETTER E WITH CEDILLA AND BREVE */
-+  IBUS_KEY_Multi_key, IBUS_KEY_e, IBUS_KEY_e, 0,
-     0, 0x018F, /* U018f */
--  IBUS_KEY_Multi_key, IBUS_KEY_acute, 0x03D2, 0, 0,
--    0, 0x03D3, /* U03D3 # GREEK UPSILON WITH ACUTE AND HOOK SYMBOL */
--  IBUS_KEY_Multi_key, 0x2203, 0x0338, 0, 0,
--    0, 0x2204, /* U2204 # THERE DOES NOT EXIST */
--  IBUS_KEY_Multi_key, 0x2208, 0x0338, 0, 0,
--    0, 0x2209, /* U2209 # NOT AN ELEMENT OF */
--  IBUS_KEY_Multi_key, 0x220B, 0x0338, 0, 0,
--    0, 0x220C, /* U220C # DOES NOT CONTAIN AS MEMBER */
--  IBUS_KEY_Multi_key, 0x2223, 0x0338, 0, 0,
--    0, 0x2224, /* U2224 # DOES NOT DIVIDE */
--  IBUS_KEY_Multi_key, 0x2225, 0x0338, 0, 0,
--    0, 0x2226, /* U2226 # NOT PARALLEL TO */
--  IBUS_KEY_Multi_key, 0x2286, 0x0338, 0, 0,
--    0, 0x2288, /* U2288 # NEITHER A SUBSET OF NOR EQUAL TO */
--  IBUS_KEY_Multi_key, 0x2287, 0x0338, 0, 0,
--    0, 0x2289, /* U2289 # NEITHER A SUPERSET OF NOR EQUAL TO */
--  IBUS_KEY_Multi_key, 0x2291, 0x0338, 0, 0,
--    0, 0x22E2, /* U22E2 # NOT SQUARE IMAGE OF OR EQUAL TO */
--  IBUS_KEY_Multi_key, 0x2292, 0x0338, 0, 0,
--    0, 0x22E3, /* U22E3 # NOT SQUARE ORIGINAL OF OR EQUAL TO */
--  IBUS_KEY_Multi_key, 0x22B4, 0x0338, 0, 0,
--    0, 0x22EC, /* U22EC # NOT NORMAL SUBGROUP OF OR EQUAL TO */
--  IBUS_KEY_Multi_key, 0x22B5, 0x0338, 0, 0,
--    0, 0x22ED  /* U22ED # DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL */
-+  IBUS_KEY_Multi_key, IBUS_KEY_acute, 0x03D2, 0,
-+    0, 0x03D3  /* U03D3	# GREEK UPSILON WITH ACUTE AND HOOK SYMBOL */
- };
- 
- static const IBusComposeTable ibus_compose_table_pt_br = {
-     ibus_compose_seqs_pt_br,
--    5,
--    G_N_ELEMENTS (ibus_compose_seqs_pt_br) / (5 + 2)
-+    4,
-+    G_N_ELEMENTS (ibus_compose_seqs_pt_br) / (4 + 2)
- };
- 
- static const IBusComposeTableLocaleList ibus_compose_table_locale_list[] = {
--- 
-1.8.5.3
-
-From a5300750e38b5327bdd255d777544d0c0ebcb4d9 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Tue, 24 Jun 2014 11:24:40 +0900
-Subject: [PATCH] Do not sort ibus engines when they are saved by
- ibus-setup.
-
-ibus 1.5 changes the engine order with Super+space shortcut key
-and now ibus-setup shows the sorted engines by longname on UI.
-This fixes not to save the sorted order with ibus-setup.
-
-TEST=setup
-
-Review URL: https://codereview.appspot.com/102610044
----
- setup/enginetreeview.py | 13 ++++++++-----
- setup/main.py           |  3 ++-
- 2 files changed, 10 insertions(+), 6 deletions(-)
-
-diff --git a/setup/enginetreeview.py b/setup/enginetreeview.py
-index b116c54..3ab81b7 100644
---- a/setup/enginetreeview.py
-+++ b/setup/enginetreeview.py
-@@ -47,7 +47,7 @@ class EngineTreeView(Gtk.TreeView):
-     def __init__(self):
-         super(EngineTreeView, self).__init__()
- 
--        self.__engines = set([])
-+        self.__engines = []
-         self.__changed = False
- 
-         # self.set_headers_visible(True)
-@@ -186,13 +186,13 @@ class EngineTreeView(Gtk.TreeView):
- 
-     def set_engines(self, engines):
-         self.__model.clear()
--        self.__engines = set([])
-+        self.__engines = []
-         for e in engines:
-             if e in self.__engines:
-                 continue
-             it = self.__model.append(None)
-             self.__model.set(it, 0, e)
--            self.__engines.add(e)
-+            self.__engines.append(e)
-         self.__emit_changed()
- 
-     def get_selected_iter(self):
-@@ -201,6 +201,9 @@ class EngineTreeView(Gtk.TreeView):
-             return selection.get_selected()[1]
- 
-     def get_engines(self):
-+        return self.__engines
-+
-+    def get_sorted_engines(self):
-         return self.get_property("engines")
- 
-     def get_active_engine(self):
-@@ -211,7 +214,7 @@ class EngineTreeView(Gtk.TreeView):
-             return
-         it = self.__model.prepend(None)
-         self.__model.set(it, 0, engine)
--        self.__engines.add(engine)
-+        self.__engines = [engine] + self.__engines
-         self.scroll_to_cell(self.__model[0].path, None)
- 
-     def append_engine(self, engine):
-@@ -219,7 +222,7 @@ class EngineTreeView(Gtk.TreeView):
-             return
-         it = self.__model.append(None)
-         self.__model.set(it, 0, engine)
--        self.__engines.add(engine)
-+        self.__engines.append(engine)
-         self.scroll_to_cell(self.__model[-1].path, None)
- 
-     def remove_engine(self):
-diff --git a/setup/main.py b/setup/main.py
-index dee7be4..1d89f3d 100644
---- a/setup/main.py
-+++ b/setup/main.py
-@@ -274,7 +274,7 @@ class Setup(object):
-         if prop.name not in ("active-engine", "engines"):
-             return
- 
--        engines = self.__treeview.get_engines()
-+        engines = self.__treeview.get_sorted_engines()
-         engine = self.__treeview.get_active_engine()
- 
-         self.__builder.get_object("button_engine_remove").set_sensitive(engine != None)
-@@ -289,6 +289,7 @@ class Setup(object):
-             obj.set_sensitive(False)
- 
-         if prop.name == "engines":
-+            engines = self.__treeview.get_engines()
-             engine_names = [e.get_name() for e in engines]
-             self.__settings_general.set_strv('preload-engines', engine_names)
- 
--- 
-1.8.5.3
-
-From 8ef258ec31f12405e4f5ded6a7a4d80114a219d4 Mon Sep 17 00:00:00 2001
-From: Osamu Aoki <osamu@debian.org>
-Date: Thu, 3 Jul 2014 11:39:32 +0900
-Subject: [PATCH] Use "keycode Linux_keycode = X11_keysym" format
-
-Delete non-Linux keyboard compatibility.
-
-These are tested for both PC and Mac. Using showkey and xev
-
-Notably:
-
-  Hangul = Eisuu-on-mac-keyboard
-  Hangul_Hanja = Kana/kana -on-mac-keyboard
-
-BUG=http://code.google.com/p/ibus/issues/detail?id=1724
-TEST=data/keymaps/keycode.py
-
-Review URL: https://codereview.appspot.com/106250045
-Patch from Osamu Aoki <osamu@debian.org>.
----
- data/keymaps/jp | 15 +++++++++------
- 1 file changed, 9 insertions(+), 6 deletions(-)
-
-diff --git a/data/keymaps/jp b/data/keymaps/jp
-index 2c78347..e5546fa 100644
---- a/data/keymaps/jp
-+++ b/data/keymaps/jp
-@@ -31,11 +31,14 @@ keycode 52 = period
- keycode 53 = slash
-     shift keycode 53 = question
-     shift keycode 58 = Eisu_toggle
--    shift keycode 84 = Execute
--keycode 112 = Katakana
--keycode 115 = backslash
--    shift keycode 115 = underscore
--keycode 121 = Henkan_Mode
--keycode 123 = Muhenkan
-+keycode 89 = backslash
-+    shift keycode 89 = underscore
-+keycode 92 = Henkan_Mode
-+keycode 93 = Hiragana_Katakana
-+keycode 94 = Muhenkan
- keycode 124 = yen
-     shift keycode 124 = bar
-+keycode 122 = Hangul
-+keycode 123 = Hangul_Hanja
-+    shift keycode 84 = Execute
-+keycode 112 = Katakana
--- 
-1.8.5.3
-
-From 3dcf24742216d6234a45ace1b433b864efdf08a2 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 4 Jul 2014 16:03:57 +0900
-Subject: [PATCH] Add ibus reset-config and read-config sub-commands.
-
-BUG=rhbz#530711
-TEST=tools/ibus
-
-Review URL: https://codereview.appspot.com/103670044
----
- tools/main.vala | 48 +++++++++++++++++++++++++++++++++++++++++++++++-
- 1 file changed, 47 insertions(+), 1 deletion(-)
-
-diff --git a/tools/main.vala b/tools/main.vala
-index db4fd23..ecce80a 100644
---- a/tools/main.vala
-+++ b/tools/main.vala
-@@ -20,6 +20,12 @@
-  * USA
-  */
- 
-+private const string[] IBUS_SCHEMAS = {
-+    "org.freedesktop.ibus.general",
-+    "org.freedesktop.ibus.general.hotkey",
-+    "org.freedesktop.ibus.panel",
-+};
-+
- bool name_only = false;
- /* system() exists as a public API. */
- bool is_system = false;
-@@ -276,6 +282,44 @@ int print_address(string[] argv) {
-     return Posix.EXIT_SUCCESS;
- }
- 
-+int read_config(string[] argv) {
-+    var output = new GLib.StringBuilder();
-+
-+    foreach (string schema in IBUS_SCHEMAS) {
-+        GLib.Settings settings = new GLib.Settings(schema);
-+
-+        output.append_printf("SCHEMA: %s\n", schema);
-+
-+        foreach (string key in settings.list_keys()) {
-+            GLib.Variant variant = settings.get_value(key);
-+            output.append_printf("  %s: %s\n", key, variant.print(true));
-+        }
-+    }
-+    print("%s", output.str);
-+
-+    return Posix.EXIT_SUCCESS;
-+}
-+
-+int reset_config(string[] argv) {
-+    print("%s\n", _("Resetting…"));
-+
-+    foreach (string schema in IBUS_SCHEMAS) {
-+        GLib.Settings settings = new GLib.Settings(schema);
-+
-+        print("SCHEMA: %s\n", schema);
-+
-+        foreach (string key in settings.list_keys()) {
-+            print("  %s\n", key);
-+            settings.reset(key);
-+        }
-+    }
-+
-+    GLib.Settings.sync();
-+    print("%s\n", _("Done"));
-+
-+    return Posix.EXIT_SUCCESS;
-+}
-+
- int print_help(string[] argv) {
-     print_usage(stdout);
-     return Posix.EXIT_SUCCESS;
-@@ -299,6 +343,8 @@ static const CommandEntry commands[]  = {
-     { "read-cache", N_("Show the content of registry cache"), read_cache },
-     { "write-cache", N_("Create registry cache"), write_cache },
-     { "address", N_("Print the D-Bus address of ibus-daemon"), print_address },
-+    { "read-config", N_("Show the configuration values"), read_config },
-+    { "reset-config", N_("Reset the configuration values"), reset_config },
-     { "help", N_("Show this information"), print_help }
- };
- 
-@@ -308,7 +354,7 @@ void print_usage(FileStream stream) {
-     stream.printf(_("Usage: %s COMMAND [OPTION...]\n\n"), program_name);
-     stream.printf(_("Commands:\n"));
-     for (int i = 0; i < commands.length; i++) {
--        stream.printf("  %-11s    %s\n",
-+        stream.printf("  %-12s    %s\n",
-                       commands[i].name,
-                       GLib.dgettext(null, commands[i].description));
-     }
--- 
-1.8.5.3
-
-From 9e5a2bd2c40f9eed8d99710b63b3dab737aa9b95 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Tue, 8 Jul 2014 11:42:12 +0900
-Subject: [PATCH] Update ibus(1) for read-config and reset-config.
-
-TEST=tools/ibus.1.gz
-
-Review URL: https://codereview.appspot.com/111900044
----
- tools/ibus.1.in | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/tools/ibus.1.in b/tools/ibus.1.in
-index ab99db4..6ac92ff 100644
---- a/tools/ibus.1.in
-+++ b/tools/ibus.1.in
-@@ -85,6 +85,13 @@ directories, separated by ':'.
- \fBaddress\fR
- Show the D-Bus address of ibus-daemon.
- .TP
-+\fBread\-config\fR
-+Print the setting values in a gsettings configuration file.
-+.TP
-+\fBreset\-config\fR
-+Reset the user setting values to the default ones in a gsettings
-+configuration file.
-+.TP
- \fBwatch\fR
- Under construction.
- .TP
--- 
-1.8.5.3
-
-From 10483bfebd1f51ffa52ad7d017193ae728f93bf5 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 10 Jul 2014 11:54:30 +0900
-Subject: [PATCH] Fix ibus-setup SEGV in enginetreeview.py
-
-When an engine is added on ibus-setup, enginetreeview.append_engine()
-calls self.__model.append(None) and it causes engine == None in
-__icon_cell_data_cb() and __name_cell_data_cb() in enginetreeview
-with python3-gobject 3.13.x which version has implemented several
-deprecated warnings in gi/overrides/Gtk.py .
-I think this problem also could happen in the old versions if
-the system would be slow.
-
-BUG=rhbz#1048429
-TEST=setup in Fedora 21
-
-Review URL: https://codereview.appspot.com/104620043
----
- setup/enginetreeview.py | 15 +++++++++++++--
- 1 file changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/setup/enginetreeview.py b/setup/enginetreeview.py
-index 3ab81b7..afb23fc 100644
---- a/setup/enginetreeview.py
-+++ b/setup/enginetreeview.py
-@@ -128,12 +128,25 @@ class EngineTreeView(Gtk.TreeView):
-     def __icon_cell_data_cb(self, celllayout, renderer, model, it, data):
-         engine = self.__model.get_value(it, 0)
- 
-+        # When append_engine() is called, self.__model.append(None)
-+        # is called internally and engine == None could happen in
-+        # a slow system.
-+        if engine == None:
-+            return
-+
-         icon_size = Gtk.icon_size_lookup(Gtk.IconSize.LARGE_TOOLBAR)[0]
-         pixbuf = load_icon(engine.get_icon(), Gtk.IconSize.LARGE_TOOLBAR)
-         renderer.set_property("pixbuf", pixbuf)
- 
-     def __name_cell_data_cb(self, celllayout, renderer, model, it, data):
-         engine = self.__model.get_value(it, 0)
-+
-+        # When append_engine() is called, self.__model.append(None)
-+        # is called internally and engine == None could happen in
-+        # a slow system.
-+        if engine == None:
-+            return
-+
-         renderer.set_property("sensitive", True)
-         language = IBus.get_language_name(engine.get_language())
-         renderer.set_property("text",
-@@ -215,7 +228,6 @@ class EngineTreeView(Gtk.TreeView):
-         it = self.__model.prepend(None)
-         self.__model.set(it, 0, engine)
-         self.__engines = [engine] + self.__engines
--        self.scroll_to_cell(self.__model[0].path, None)
- 
-     def append_engine(self, engine):
-         if engine == None or engine in self.__engines:
-@@ -223,7 +235,6 @@ class EngineTreeView(Gtk.TreeView):
-         it = self.__model.append(None)
-         self.__model.set(it, 0, engine)
-         self.__engines.append(engine)
--        self.scroll_to_cell(self.__model[-1].path, None)
- 
-     def remove_engine(self):
-         it = self.get_selected_iter()
--- 
-1.8.5.3
-
-From a17dc8e8bd288adedb77ae417d6825419337daae Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 11 Jul 2014 11:45:05 +0900
-Subject: [PATCH] Fix deprecated warnings with python3-gobject 3.13.3.
-
-python3-gobject adds several warnings in gi/overrides/Gtk.py
-
-/usr/share/ibus/setup/main.py:74: PyGIDeprecationWarning:
-Using positional arguments with the GObject constructor has been
-deprecated. Please specify keyword(s) for "schema" or use a class
-specific constructor.
-See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
-
-/usr/share/ibus/setup/main.py:364: PyGTKDeprecationWarning:
-The keyword(s) "type" have been deprecated in favor of "message_type"
-respectively.
-See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
-
-TEST=setup
-
-Review URL: https://codereview.appspot.com/110990044
----
- setup/engineabout.py      | 12 +++++++-----
- setup/keyboardshortcut.py | 32 ++++++++++++++++++--------------
- setup/main.py             | 30 ++++++++++++++++++------------
- setup/setup.ui            |  2 ++
- 4 files changed, 45 insertions(+), 31 deletions(-)
-
-diff --git a/setup/engineabout.py b/setup/engineabout.py
-index 50ab001..09e9b5c 100644
---- a/setup/engineabout.py
-+++ b/setup/engineabout.py
-@@ -29,12 +29,14 @@ from gi.repository import Pango
- from i18n import _, N_
- 
- class EngineAbout(Gtk.Dialog):
--    def __init__(self, enginedesc):
--        self.__engine_desc = enginedesc
--        super(EngineAbout, self).__init__(_("About"), None,
--                Gtk.DialogFlags.MODAL,
--                (_("_Close"), Gtk.ResponseType.CLOSE))
-+    def __init__(self, engine, transient_for = None):
-+        self.__engine_desc = engine
-+        super(EngineAbout, self).__init__(
-+                title = _("About"),
-+                transient_for = transient_for)
- 
-+        buttons = (_("_Close"), Gtk.ResponseType.CLOSE)
-+        self.add_buttons(*buttons)
-         self.__init_ui()
- 
-     def __init_ui(self):
-diff --git a/setup/keyboardshortcut.py b/setup/keyboardshortcut.py
-index d82fea8..91595f7 100644
---- a/setup/keyboardshortcut.py
-+++ b/setup/keyboardshortcut.py
-@@ -49,7 +49,8 @@ class KeyboardShortcutSelection(Gtk.Box):
-         # self.pack_start(label, False, True, 4)
- 
-         # shortcuts view
--        self.__shortcut_view = Gtk.TreeView(Gtk.ListStore(GObject.TYPE_STRING))
-+        self.__shortcut_view = Gtk.TreeView(
-+                model = Gtk.ListStore(GObject.TYPE_STRING))
-         self.__shortcut_view.set_size_request(-1, 100)
-         renderer = Gtk.CellRendererText()
-         column = Gtk.TreeViewColumn(_("Keyboard shortcuts"), renderer, text = 0)
-@@ -63,7 +64,7 @@ class KeyboardShortcutSelection(Gtk.Box):
- 
-         # key code
-         hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
--        label = Gtk.Label(_("Key code:"))
-+        label = Gtk.Label(label = _("Key code:"))
-         label.set_justify(Gtk.Justification.LEFT)
-         label.set_alignment(0.0, 0.5)
-         hbox.pack_start(label, False, True, 4)
-@@ -71,19 +72,19 @@ class KeyboardShortcutSelection(Gtk.Box):
-         self.__keycode_entry = Gtk.Entry()
-         self.__keycode_entry.connect("notify::text", self.__keycode_entry_notify_cb)
-         hbox.pack_start(self.__keycode_entry, True, True, 4)
--        self.__keycode_button = Gtk.Button("...")
-+        self.__keycode_button = Gtk.Button(label = "...")
-         self.__keycode_button.connect("clicked", self.__keycode_button_clicked_cb)
-         hbox.pack_start(self.__keycode_button, False, True, 4)
-         self.pack_start(hbox, False, True, 4)
- 
-         # modifiers
-         hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
--        label = Gtk.Label(_("Modifiers:"))
-+        label = Gtk.Label(label = _("Modifiers:"))
-         label.set_justify(Gtk.Justification.LEFT)
-         label.set_alignment(0.0, 0.5)
-         hbox.pack_start(label, False, True, 4)
- 
--        table = Gtk.Table(4, 2)
-+        table = Gtk.Table(n_rows = 4, n_columns = 2)
-         self.__modifier_buttons = []
-         self.__modifier_buttons.append(("Control",
-                                         Gtk.CheckButton.new_with_mnemonic("_Control"),
-@@ -250,8 +251,10 @@ class KeyboardShortcutSelection(Gtk.Box):
- 
-     def __keycode_button_clicked_cb(self, button):
-         out = []
--        dlg = Gtk.MessageDialog(parent = self.get_toplevel(), buttons = Gtk.ButtonsType.CLOSE)
--        message = _("Please press a key (or a key combination).\nThe dialog will be closed when the key is released.")
-+        dlg = Gtk.MessageDialog(transient_for = self.get_toplevel(),
-+                                buttons = Gtk.ButtonsType.CLOSE)
-+        message = _("Please press a key (or a key combination).\n" \
-+                    "The dialog will be closed when the key is released.")
-         dlg.set_markup(message)
-         dlg.set_title(_("Please press a key (or a key combination)"))
-         sw = Gtk.ScrolledWindow()
-@@ -265,7 +268,7 @@ class KeyboardShortcutSelection(Gtk.Box):
-         model = Gtk.ListStore(GObject.TYPE_INT,
-                               GObject.TYPE_UINT,
-                               GObject.TYPE_UINT)
--        accel_view = Gtk.TreeView(model)
-+        accel_view = Gtk.TreeView(model = model)
-         sw.add(accel_view)
-         column = Gtk.TreeViewColumn()
-         renderer = Gtk.CellRendererAccel(accel_mode=Gtk.CellRendererAccelMode.OTHER,
-@@ -315,8 +318,9 @@ class KeyboardShortcutSelection(Gtk.Box):
-         self.__apply_button.set_sensitive(False)
- 
- class KeyboardShortcutSelectionDialog(Gtk.Dialog):
--    def __init__(self, title = None, parent = None, flags = 0, buttons = None):
--        super(KeyboardShortcutSelectionDialog, self).__init__(title, parent, flags, buttons)
-+    def __init__(self, title = None, transient_for = None, flags = 0):
-+        super(KeyboardShortcutSelectionDialog, self).__init__(
-+                title = title, transient_for = transient_for, flags = flags)
-         self.__selection_view = KeyboardShortcutSelection()
-         self.vbox.pack_start(self.__selection_view, False, True, 0)
-         self.vbox.show_all()
-@@ -333,10 +337,10 @@ class KeyboardShortcutSelectionDialog(Gtk.Dialog):
- 
- 
- if __name__ == "__main__":
--    dlg = KeyboardShortcutSelectionDialog(
--        title = "Select test",
--        buttons = (_("_Cancel"), Gtk.ResponseType.CANCEL,
--                   _("_OK"), Gtk.ResponseType.OK))
-+    dlg = KeyboardShortcutSelectionDialog(title = "Select test")
-+    buttons = (_("_Cancel"), Gtk.ResponseType.CANCEL,
-+               _("_OK"), Gtk.ResponseType.OK)
-+    dlg.add_buttons(buttons)
-     dlg.add_shortcut("Control+Shift+space")
-     dlg.set_shortcuts(None)
-     print((dlg.run()))
-diff --git a/setup/main.py b/setup/main.py
-index 1d89f3d..1bc9cfb 100644
---- a/setup/main.py
-+++ b/setup/main.py
-@@ -70,10 +70,12 @@ class Setup(object):
-     def __init__(self):
-         super(Setup, self).__init__()
- 
--        self.__settings_general = Gio.Settings("org.freedesktop.ibus.general");
-+        self.__settings_general = Gio.Settings(
-+                schema = "org.freedesktop.ibus.general");
-         self.__settings_hotkey = Gio.Settings(
--                "org.freedesktop.ibus.general.hotkey");
--        self.__settings_panel = Gio.Settings("org.freedesktop.ibus.panel");
-+                schema = "org.freedesktop.ibus.general.hotkey");
-+        self.__settings_panel = Gio.Settings(
-+                schema = "org.freedesktop.ibus.panel");
- 
-         # IBus.Bus() calls ibus_bus_new().
-         # Gtk.Builder().add_from_file() also calls ibus_bus_new_async()
-@@ -300,7 +302,7 @@ class Setup(object):
-     def __button_engine_about_cb(self, button):
-         engine = self.__treeview.get_active_engine()
-         if engine:
--            about = EngineAbout(engine)
-+            about = EngineAbout(engine = engine, transient_for = self.__window)
-             about.run()
-             about.destroy()
- 
-@@ -328,7 +330,7 @@ class Setup(object):
-             return
- 
-         message = _("The IBus daemon is not running. Do you wish to start it?")
--        dlg = Gtk.MessageDialog(type = Gtk.MessageType.QUESTION,
-+        dlg = Gtk.MessageDialog(message_type = Gtk.MessageType.QUESTION,
-                                 buttons = Gtk.ButtonsType.YES_NO,
-                                 text = message)
-         id = dlg.run()
-@@ -354,7 +356,7 @@ class Setup(object):
-                 "  export XMODIFIERS=@im=ibus\n"
-                 "  export QT_IM_MODULE=ibus"
-                 )
--            dlg = Gtk.MessageDialog(type = Gtk.MessageType.INFO,
-+            dlg = Gtk.MessageDialog(message_type = Gtk.MessageType.INFO,
-                                     buttons = Gtk.ButtonsType.OK,
-                                     text = message)
-             id = dlg.run()
-@@ -363,7 +365,7 @@ class Setup(object):
-         else:
-             # Translators: %d == 5 currently
-             message = _("IBus daemon could not be started in %d seconds")
--            dlg = Gtk.MessageDialog(type = Gtk.MessageType.INFO,
-+            dlg = Gtk.MessageDialog(message_type = Gtk.MessageType.INFO,
-                                     buttons = Gtk.ButtonsType.OK,
-                                     text = message % timeout)
-             id = dlg.run()
-@@ -378,7 +380,9 @@ class Setup(object):
-         # Translators: Title of the window
-         title2 = _("switching input methods")
-         title = title1 % title2
--        dialog = keyboardshortcut.KeyboardShortcutSelectionDialog(buttons = buttons, title = title)
-+        dialog = keyboardshortcut.KeyboardShortcutSelectionDialog(
-+                title = title, transient_for = self.__window)
-+        dialog.add_buttons(*buttons)
-         text = entry.get_text()
-         if text:
-             shortcuts = text.split("; ")
-@@ -409,9 +413,10 @@ class Setup(object):
-             try:
-                 self.__bus.register_start_engine(data[DATA_LANG], data[DATA_NAME])
-             except Exception as e:
--                dlg = Gtk.MessageDialog(type = Gtk.MessageType.ERROR,
-+                dlg = Gtk.MessageDialog(message_type = Gtk.MessageType.ERROR,
-+                        transient_for = self.__window,
-                         buttons = Gtk.ButtonsType.CLOSE,
--                        message_format = str(e))
-+                        text = str(e))
-                 dlg.run()
-                 dlg.destroy()
-                 self.__flush_gtk_events()
-@@ -420,9 +425,10 @@ class Setup(object):
-             try:
-                 self.__bus.register_stop_engine(data[DATA_LANG], data[DATA_NAME])
-             except Exception as e:
--                dlg = Gtk.MessageDialog(type = Gtk.MessageType.ERROR,
-+                dlg = Gtk.MessageDialog(message_type = Gtk.MessageType.ERROR,
-+                        transient_for = self.__window,
-                         buttons = Gtk.ButtonsType.CLOSE,
--                        message_format = str(e))
-+                        text = str(e))
-                 dlg.run()
-                 dlg.destroy()
-                 self.__flush_gtk_events()
-diff --git a/setup/setup.ui b/setup/setup.ui
-index bb78433..d7801ea 100644
---- a/setup/setup.ui
-+++ b/setup/setup.ui
-@@ -62,6 +62,8 @@
-     <property name="resizable">False</property>
-     <property name="window_position">center-always</property>
-     <property name="icon_name">ibus-setup</property>
-+    <!-- for GtkFontChooserDialog -->
-+    <property name="modal">True</property>
-     <child>
-       <object class="GtkBox" id="vbox1">
-         <property name="orientation">vertical</property>
--- 
-1.8.5.3
-
-From b1b4e2946682e3d53aa396d8469c7fa16a2dbca8 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 11 Jul 2014 11:50:04 +0900
-Subject: [PATCH] Export the 'IBUS_SETUP_XID' environment variable for each
- engine setup.
-
-Follow GNOME_CONTROL_CENTER_XID.
-https://wiki.gnome.org/AllanDay/IMEGuidelines
-
-TEST=setup
-
-Review URL: https://codereview.appspot.com/112920044
----
- setup/main.py | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/setup/main.py b/setup/main.py
-index 1bc9cfb..e4ddd45 100644
---- a/setup/main.py
-+++ b/setup/main.py
-@@ -28,6 +28,7 @@ import signal
- import sys
- import time
- 
-+from gi.repository import GdkX11
- from gi.repository import Gio
- from gi.repository import GLib
- from gi.repository import Gtk
-@@ -233,6 +234,7 @@ class Setup(object):
-         # add icon search path
-         self.__window = self.__builder.get_object("window_preferences")
-         self.__window.connect("delete-event", Gtk.main_quit)
-+        self.__window.connect("notify::window", self.__gdk_window_set_cb)
- 
-         self.__button_close = self.__builder.get_object("button_close")
-         self.__button_close.connect("clicked", Gtk.main_quit)
-@@ -248,6 +250,10 @@ class Setup(object):
-         self.__init_panel()
-         self.__init_general()
- 
-+    def __gdk_window_set_cb(self, object, pspec):
-+        str = '%u' % GdkX11.X11Window.get_xid(object.get_window())
-+        GLib.setenv('IBUS_SETUP_XID', str, True)
-+
-     def __combobox_notify_active_engine_cb(self, combobox, property):
-         engine = self.__combobox.get_active_engine()
-         button = self.__builder.get_object("button_engine_add")
--- 
-1.8.5.3
-
-From 9b2004efcd26e11bbd56cf51656fe326fc11be8e Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 14 Jul 2014 11:45:25 +0900
-Subject: [PATCH] Call GLib.set_prgname('ibus-setup') for ibus-setup
- main.py
-
-TEST=xlsclients
-
-Review URL: https://codereview.appspot.com/108550043
----
- setup/main.py | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/setup/main.py b/setup/main.py
-index e4ddd45..9bd0af1 100644
---- a/setup/main.py
-+++ b/setup/main.py
-@@ -28,9 +28,13 @@ import signal
- import sys
- import time
- 
-+from gi.repository import GLib
-+# set_prgname before importing other modules to show the name in warning
-+# messages when import modules are failed.
-+GLib.set_prgname('ibus-setup')
-+
- from gi.repository import GdkX11
- from gi.repository import Gio
--from gi.repository import GLib
- from gi.repository import Gtk
- from gi.repository import IBus
- from os import path
--- 
-1.8.5.3
 

diff --git a/ibus-xx-bridge-hotkey.patch b/ibus-xx-bridge-hotkey.patch
deleted file mode 100644
index c3d864f..0000000
--- a/ibus-xx-bridge-hotkey.patch
+++ /dev/null
@@ -1,2294 +0,0 @@
-From 18ad10e6dd89a0327fa29535f03fa51b953e7635 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 28 Nov 2011 12:23:06 +0900
-Subject: [PATCH] Add a bridge hotkey which use prev-next engines instead
- of on-off.
-
----
- bus/Makefile.am                 |   20 +-
- bus/ibusimpl.c                  |  598 +++++++++++++++++++++++++++++++++++----
- bus/inputcontext.c              |   81 ++++++
- bus/inputcontext.h              |   22 ++
- bus/registry.c                  |   61 ++++
- bus/registry.h                  |   10 +
- configure.ac                    |   31 ++
- data/Makefile.am                |    6 +-
- data/ibus.schemas.in            |  298 -------------------
- data/ibus.schemas.in.in         |  311 ++++++++++++++++++++
- ibus/_config.py.in              |    6 +
- ibus/inputcontext.py            |   17 +-
- ibus/interface/iinputcontext.py |    7 +-
- ibus/xkbxml.py.in               |    4 +
- setup/enginecombobox.py         |    3 +
- setup/enginetreeview.py         |    8 +-
- setup/main.py                   |   45 +++
- setup/setup.ui                  |   64 ++++-
- src/Makefile.am                 |   18 +-
- src/ibushotkey.c                |   11 +
- src/ibushotkey.h                |   11 +
- src/ibusinputcontext.c          |   27 ++
- src/ibusinputcontext.h          |   12 +
- src/ibusutil.c                  |   12 +
- src/ibusutil.h                  |   14 +
- ui/gtk/panel.py                 |  335 ++++++++++++++++++++--
- xkb/Makefile.am                 |    2 +
- xkb/ibus-engine-xkb-main.c      |   16 +
- xkb/xkbxml.c                    |   10 +-
- 29 files changed, 1653 insertions(+), 407 deletions(-)
- delete mode 100644 data/ibus.schemas.in
- create mode 100644 data/ibus.schemas.in.in
-
-diff --git a/bus/Makefile.am b/bus/Makefile.am
-index 074b456..0efaa1b 100644
---- a/bus/Makefile.am
-+++ b/bus/Makefile.am
-@@ -29,15 +29,17 @@ INCLUDES =                \
- 	-I$(top_builddir)/src \
- 	$(NULL)
- 
--AM_CFLAGS =                        \
--	@GLIB2_CFLAGS@                 \
--	@GIO2_CFLAGS@                  \
--	@GTHREAD2_CFLAGS@              \
--	-DG_LOG_DOMAIN=\"IBUS\"        \
--	-DPKGDATADIR=\"$(pkgdatadir)\" \
--	-DLIBEXECDIR=\"$(libexecdir)\" \
--	-DBINDIR=\"@bindir@\"          \
--	$(INCLUDES)                    \
-+AM_CFLAGS =                                                            \
-+	@GLIB2_CFLAGS@                                                 \
-+	@GIO2_CFLAGS@                                                  \
-+	@GTHREAD2_CFLAGS@                                              \
-+	-DG_LOG_DOMAIN=\"IBUS\"                                        \
-+	-DPKGDATADIR=\"$(pkgdatadir)\"                                 \
-+	-DLIBEXECDIR=\"$(libexecdir)\"                                 \
-+	-DBINDIR=\"@bindir@\"                                          \
-+	-DUSE_BRIDGE_HOTKEY=$(USE_BRIDGE_HOTKEY)                       \
-+	-DDEFAULT_BRIDGE_ENGINE_NAME=\"$(DEFAULT_BRIDGE_ENGINE_NAME)\" \
-+	$(INCLUDES)                                                    \
- 	$(NULL)
- AM_LDADD =                  \
- 	@GOBJECT2_LIBS@         \
-diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
-index 059d660..67761fb 100644
---- a/bus/ibusimpl.c
-+++ b/bus/ibusimpl.c
-@@ -20,12 +20,17 @@
-  * Boston, MA 02111-1307, USA.
-  */
- 
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
- #include <unistd.h>
- #include <sys/types.h>
- #include <sys/wait.h>
- #include <signal.h>
- #include <locale.h>
- #include <strings.h>
-+#include <string.h>
- #include "types.h"
- #include "ibusimpl.h"
- #include "dbusimpl.h"
-@@ -79,6 +84,11 @@ struct _BusIBusImpl {
-     /* engine-specific hotkeys */
-     IBusHotkeyProfile *engines_hotkey_profile;
-     GHashTable      *hotkey_to_engines_map;
-+
-+#if USE_BRIDGE_HOTKEY
-+    IBusEngineDesc *prev_hotkey_engine;
-+    guint           xkb_group_length;
-+#endif
- };
- 
- struct _BusIBusImplClass {
-@@ -99,6 +109,8 @@ enum {
- static guint            _signals[LAST_SIGNAL] = { 0 };
- */
- 
-+static gchar           *_bridge_trigger_keys = NULL;
-+
- /* functions prototype */
- static void      bus_ibus_impl_destroy           (BusIBusImpl        *ibus);
- static void      bus_ibus_impl_service_method_call
-@@ -285,6 +297,112 @@ _panel_destroy_cb (BusPanelProxy *panel,
-     g_object_unref (panel);
- }
- 
-+/**
-+ * _foreach_remove_engine_hotkey:
-+ *
-+ * Remove the engine-specific hot key of the engine, and update ibus->engines_hotkey_profile.
-+ */
-+gboolean
-+_foreach_remove_engine_hotkey (gpointer        key,
-+                               gpointer        value,
-+                               gpointer        data)
-+{
-+    GQuark event = GPOINTER_TO_UINT (value);
-+    struct _impl_and_desc {
-+        BusIBusImpl    *ibus;
-+        IBusEngineDesc *desc;
-+    } *id = (struct _impl_and_desc *) data;
-+    BusIBusImpl *ibus = id->ibus;
-+    IBusEngineDesc *desc = id->desc;
-+    GList *engine_list;
-+
-+    g_assert (ibus != NULL);
-+    g_assert (desc != NULL);
-+
-+    if (event == 0) {
-+        return FALSE;
-+    }
-+
-+    engine_list = g_hash_table_lookup (ibus->hotkey_to_engines_map,
-+                                       GUINT_TO_POINTER (event));
-+
-+    /* As we will rebuild the engines hotkey map whenever an engine was
-+     * added or removed, we don't need to hold a reference of the engine
-+     * here. */
-+    if (engine_list && g_list_find (engine_list, desc) != NULL) {
-+        engine_list = g_list_remove (engine_list, desc);
-+    }
-+
-+    /* We need to steal the value before adding it back, otherwise it will
-+     * be destroyed. */
-+    g_hash_table_steal (ibus->hotkey_to_engines_map, GUINT_TO_POINTER (event));
-+
-+    if (engine_list != NULL) {
-+        g_hash_table_insert (ibus->hotkey_to_engines_map,
-+                             GUINT_TO_POINTER (event), engine_list);
-+    }
-+
-+    return FALSE;
-+}
-+
-+/**
-+ * _add_engine_hotkey_with_hotkeys:
-+ *
-+ * Check the engine-specific hot key of the engine, and update ibus->engines_hotkey_profile.
-+ */
-+static void
-+_add_engine_hotkey_with_hotkeys (IBusEngineDesc *engine,
-+                                 BusIBusImpl    *ibus,
-+                                 const gchar    *hotkeys)
-+{
-+    gchar **hotkey_list;
-+    gchar **p;
-+    gchar *hotkey;
-+    GList *engine_list;
-+
-+    GQuark event;
-+    guint keyval;
-+    guint modifiers;
-+
-+    g_assert (engine != NULL);
-+    g_assert (hotkeys && *hotkeys);
-+
-+    hotkey_list = g_strsplit_set (hotkeys, ";,", 0);
-+
-+    for (p = hotkey_list; p && *p; ++p) {
-+        hotkey = g_strstrip (*p);
-+        if (!*hotkey || !ibus_key_event_from_string (hotkey, &keyval, &modifiers)) {
-+            continue;
-+        }
-+
-+        /* If the hotkey already exists, we won't need to add it again. */
-+        event = ibus_hotkey_profile_lookup_hotkey (ibus->engines_hotkey_profile,
-+                                                   keyval, modifiers);
-+        if (event == 0) {
-+            event = g_quark_from_string (hotkey);
-+            ibus_hotkey_profile_add_hotkey (ibus->engines_hotkey_profile,
-+                                            keyval, modifiers, event);
-+        }
-+
-+        engine_list = g_hash_table_lookup (ibus->hotkey_to_engines_map,
-+                                           GUINT_TO_POINTER (event));
-+
-+        /* As we will rebuild the engines hotkey map whenever an engine was
-+         * added or removed, we don't need to hold a reference of the engine
-+         * here. */
-+        engine_list = g_list_append (engine_list, engine);
-+
-+        /* We need to steal the value before adding it back, otherwise it will
-+         * be destroyed. */
-+        g_hash_table_steal (ibus->hotkey_to_engines_map, GUINT_TO_POINTER (event));
-+
-+        g_hash_table_insert (ibus->hotkey_to_engines_map,
-+                             GUINT_TO_POINTER (event), engine_list);
-+    }
-+
-+    g_strfreev (hotkey_list);
-+}
-+
- static void
- _config_set_value_done (GObject      *object,
-                         GAsyncResult *res,
-@@ -572,6 +690,67 @@ bus_ibus_impl_set_hotkey (BusIBusImpl *i
- 
- }
- 
-+#if USE_BRIDGE_HOTKEY
-+static gboolean
-+use_bridge_hotkey (BusIBusImpl *ibus)
-+{
-+    GVariant *variant = NULL;
-+    gboolean _use_bridge_hotkey = TRUE;
-+
-+    g_assert (ibus != NULL);
-+
-+    if (!ibus->config) {
-+        return TRUE;
-+    }
-+
-+    variant = ibus_config_get_value (ibus->config,
-+                                     "general/hotkey",
-+                                     "use_bridge_hotkey");
-+
-+    if (variant != NULL) {
-+        g_variant_get (variant, "b", &_use_bridge_hotkey);
-+        g_variant_unref (variant);
-+    }
-+
-+    return _use_bridge_hotkey;
-+}
-+
-+static void
-+bus_ibus_impl_set_bridge_trigger_keys (BusIBusImpl *ibus,
-+                                       GQuark       hotkey,
-+                                       GVariant    *value)
-+{
-+    g_assert (BUS_IS_IBUS_IMPL (ibus));
-+
-+    ibus_hotkey_profile_remove_hotkey_by_event (ibus->hotkey_profile, hotkey);
-+
-+    if (value == NULL) {
-+        return;
-+    }
-+
-+    GVariantIter iter;
-+    g_variant_iter_init (&iter, value);
-+    const gchar *str = NULL;
-+
-+    g_free (_bridge_trigger_keys);
-+    _bridge_trigger_keys = NULL;
-+
-+    while (g_variant_iter_loop (&iter,"&s", &str)) {
-+       if (str != NULL) {
-+           gchar *tmp =NULL;
-+
-+           if (_bridge_trigger_keys) {
-+               tmp = g_strdup_printf ("%s,%s", _bridge_trigger_keys, str);
-+           } else {
-+               tmp = g_strdup (str);
-+           }
-+           g_free (_bridge_trigger_keys);
-+           _bridge_trigger_keys = tmp;
-+       }
-+    }
-+}
-+#endif
-+
- /**
-  * bus_ibus_impl_set_trigger:
-  *
-@@ -583,7 +762,15 @@ bus_ibus_impl_set_trigger (BusIBusImpl *
- {
-     GQuark hotkey = g_quark_from_static_string ("trigger");
-     if (value != NULL) {
-+#if USE_BRIDGE_HOTKEY
-+        if (use_bridge_hotkey (ibus)) {
-+            bus_ibus_impl_set_bridge_trigger_keys (ibus, hotkey, value);
-+        } else {
-+            bus_ibus_impl_set_hotkey (ibus, hotkey, value);
-+        }
-+#else
-         bus_ibus_impl_set_hotkey (ibus, hotkey, value);
-+#endif
-     }
- #ifndef OS_CHROMEOS
-     else {
-@@ -649,6 +836,72 @@ bus_ibus_impl_set_previous_engine (BusIB
-     bus_ibus_impl_set_hotkey (ibus, hotkey, value);
- }
- 
-+#if USE_BRIDGE_HOTKEY
-+static gint
-+_engine_desc_name_cmp (IBusEngineDesc *desc1,
-+                       IBusEngineDesc *desc2)
-+{
-+    return g_strcmp0 (ibus_engine_desc_get_name (desc1),
-+                      ibus_engine_desc_get_name (desc2));
-+}
-+
-+static void
-+_set_register_engines (BusIBusImpl *ibus,
-+                       GVariant    *value)
-+{
-+    GList *engine_list = NULL;
-+
-+    g_assert (BUS_IS_IBUS_IMPL (ibus));
-+
-+    engine_list = ibus->register_engine_list;
-+    if (value != NULL && g_variant_classify (value) == G_VARIANT_CLASS_ARRAY) {
-+        GVariantIter iter;
-+        g_variant_iter_init (&iter, value);
-+        const gchar *engine_name = NULL;
-+        while (g_variant_iter_loop (&iter, "&s", &engine_name)) {
-+            IBusEngineDesc *engine = bus_registry_find_engine_by_name (ibus->registry, engine_name);
-+            if (engine == NULL || g_list_find (engine_list, engine) != NULL)
-+                continue;
-+            engine_list = g_list_append (engine_list, g_object_ref (engine));
-+        }
-+    } else if (value != NULL) {
-+        g_variant_unref (value);
-+    }
-+
-+    ibus->register_engine_list = engine_list;
-+
-+    if (engine_list) {
-+        BusComponent *component = bus_component_from_engine_desc ((IBusEngineDesc *) engine_list->data);
-+        if (component && !bus_component_is_running (component)) {
-+            bus_component_start (component, g_verbose);
-+        }
-+    }
-+}
-+
-+static void
-+_set_default_keyboard_layout_engines (BusIBusImpl *ibus)
-+{
-+    GList *engines = NULL;
-+    GList *list;
-+    GVariantBuilder builder;
-+
-+    g_assert (BUS_IS_IBUS_IMPL (ibus));
-+
-+    engines = bus_registry_get_engines_by_name_prefix (ibus->registry,
-+                                                       DEFAULT_BRIDGE_ENGINE_NAME);
-+    /* sort engines by rank */
-+    engines = g_list_sort (engines, (GCompareFunc) _engine_desc_name_cmp);
-+
-+    g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
-+    for (list = engines; list != NULL; list = list->next) {
-+        IBusEngineDesc *desc = (IBusEngineDesc *)list->data;
-+        g_variant_builder_add (&builder, "s", ibus_engine_desc_get_name (desc));
-+    }
-+    _set_register_engines (ibus, g_variant_builder_end (&builder));
-+    g_list_free (engines);
-+}
-+#endif
-+
- /**
-  * bus_ibus_impl_set_preload_engines:
-  *
-@@ -668,6 +921,9 @@ bus_ibus_impl_set_preload_engines (BusIB
-             _set_preload_engines (ibus, value);
-         }
-     }
-+#if USE_BRIDGE_HOTKEY
-+    _set_default_keyboard_layout_engines (ibus);
-+#endif
- #else
-     _set_preload_engines (ibus, value);
- #endif
-@@ -1216,6 +1472,53 @@ _find_engine_desc_by_name (BusIBusImpl *
-     return NULL;
- }
- 
-+#if USE_BRIDGE_HOTKEY
-+const gchar *
-+_get_engine_desc_hotkeys_with_system (IBusEngineDesc *desc)
-+{
-+    const gchar *hotkeys = NULL;
-+
-+    /* If the user customized the trigger key, the trigger key is used for
-+     * any IBus engines. */
-+    if (_bridge_trigger_keys != NULL &&
-+        *_bridge_trigger_keys != '\0' &&
-+        g_strcmp0 (_bridge_trigger_keys, "Control+space") != 0) {
-+
-+        hotkeys = (const gchar *) _bridge_trigger_keys;
-+    } else if (desc) {
-+        hotkeys = ibus_engine_desc_get_hotkeys (desc);
-+    }
-+
-+    /* If engine hotkeys are not defined in the compose xml file,
-+     * IBus trigger keys are used. */
-+    if (!hotkeys || !*hotkeys) {
-+            hotkeys = (const gchar *) _bridge_trigger_keys;
-+    }
-+
-+    return hotkeys;
-+}
-+
-+void
-+_update_hotkeys_by_prev_engine_desc (BusIBusImpl    *ibus,
-+                                     IBusEngineDesc *next_desc,
-+                                     IBusEngineDesc *prev_desc)
-+{
-+    struct _impl_and_desc {
-+        BusIBusImpl    *ibus;
-+        IBusEngineDesc *desc;
-+    } id = {ibus, next_desc};
-+    const gchar *hotkeys = NULL;
-+
-+    hotkeys = _get_engine_desc_hotkeys_with_system (prev_desc);
-+    if (hotkeys && *hotkeys) {
-+        ibus_hotkey_profile_foreach_hotkey (ibus->engines_hotkey_profile,
-+                                            _foreach_remove_engine_hotkey,
-+                                            &id);
-+        _add_engine_hotkey_with_hotkeys (next_desc, ibus, hotkeys);
-+    }
-+}
-+#endif
-+
- /**
-  * _context_request_engine_cb:
-  *
-@@ -1226,7 +1529,53 @@ _context_request_engine_cb (BusInputCont
-                             const gchar     *engine_name,
-                             BusIBusImpl     *ibus)
- {
--    return bus_ibus_impl_get_engine_desc (ibus, engine_name);
-+    IBusEngineDesc *desc = bus_ibus_impl_get_engine_desc (ibus, engine_name);
-+
-+#if USE_BRIDGE_HOTKEY
-+    IBusEngineDesc *current_desc = NULL;
-+
-+    if (!use_bridge_hotkey (ibus)) {
-+        return desc;
-+    }
-+
-+    if (context) {
-+        BusEngineProxy *engine = bus_input_context_get_engine (context);
-+        if (engine != NULL) {
-+            current_desc = bus_engine_proxy_get_desc (engine);
-+        }
-+    }
-+
-+    if (((current_desc == NULL && desc != NULL) ||
-+         (current_desc != NULL && desc != NULL &&
-+          g_strcmp0 (ibus_engine_desc_get_name (current_desc),
-+                     ibus_engine_desc_get_name (desc)) != 0)) &&
-+        g_ascii_strncasecmp (ibus_engine_desc_get_name (desc),
-+                             DEFAULT_BRIDGE_ENGINE_NAME,
-+                             strlen (DEFAULT_BRIDGE_ENGINE_NAME)) == 0) {
-+        _update_hotkeys_by_prev_engine_desc (ibus, desc, current_desc);
-+    }
-+
-+    if (current_desc && desc &&
-+        g_strcmp0 (ibus_engine_desc_get_name (current_desc),
-+                   ibus_engine_desc_get_name (desc)) != 0) {
-+        if (context) {
-+            bus_input_context_set_prev_hotkey_engine (context, current_desc);
-+        } else {
-+            ibus->prev_hotkey_engine = current_desc;
-+        }
-+
-+        /* If the previous engine is not included in engine_list and
-+         * the current engine is the defualt bridge engine,
-+         * the current engine is also not included in engine_list.
-+         * So the engine is added here. */
-+        if (g_ascii_strncasecmp (ibus_engine_desc_get_name (current_desc),
-+                                 DEFAULT_BRIDGE_ENGINE_NAME,
-+                                 strlen (DEFAULT_BRIDGE_ENGINE_NAME)) == 0) {
-+            _update_hotkeys_by_prev_engine_desc (ibus, current_desc, desc);
-+        }
-+    }
-+#endif
-+    return desc;
- }
- 
- /**
-@@ -1265,8 +1614,13 @@ bus_ibus_impl_get_engine_desc (BusIBusIm
-         if (!desc) {
-             if (ibus->register_engine_list) {
-                 desc = (IBusEngineDesc *) ibus->register_engine_list->data;
-+#if USE_BRIDGE_HOTKEY
-+                if (engine_name == NULL) {
-+                    desc = NULL;
-+                }
-+#endif
-             }
--            else if (ibus->engine_list) {
-+            if (!desc && ibus->engine_list) {
-                 desc = (IBusEngineDesc *) ibus->engine_list->data;
-             }
-         }
-@@ -1311,9 +1665,20 @@ bus_ibus_impl_context_request_rotate_eng
-     desc = bus_engine_proxy_get_desc (engine);
- 
-     p = g_list_find (ibus->register_engine_list, desc);
-+#if USE_BRIDGE_HOTKEY
-+    if (!use_bridge_hotkey (ibus)) {
-+        p = NULL;
-+    }
-+#endif
-     if (p != NULL) {
-         if (is_next) {
-             p = p->next;
-+#if USE_BRIDGE_HOTKEY
-+            if (p && g_list_length (ibus->register_engine_list) -
-+                    g_list_length (p) >= ibus->xkb_group_length) {
-+                p = NULL;
-+            }
-+#endif
-         } else {
-             p = p->prev;
-         }
-@@ -1343,11 +1708,25 @@ bus_ibus_impl_context_request_rotate_eng
-     if (p == NULL && g_list_find (ibus->engine_list, desc) != NULL) {
-         if (is_next) {
-             p = ibus->register_engine_list;
-+#if USE_BRIDGE_HOTKEY
-+            if (!use_bridge_hotkey (ibus)) {
-+                p = NULL;
-+            }
-+#endif
-             if (p == NULL) {
-                 p = ibus->engine_list;
-             }
-         } else {
-             p = g_list_last (ibus->register_engine_list);
-+#if USE_BRIDGE_HOTKEY
-+            if (!use_bridge_hotkey (ibus)) {
-+                p = NULL;
-+            }
-+            else if (ibus->xkb_group_length > 0) {
-+                p = g_list_nth (ibus->register_engine_list,
-+                                ibus->xkb_group_length - 1);
-+            }
-+#endif
-             if (p == NULL) {
-                 p = g_list_last (ibus->engine_list);
-             }
-@@ -1358,14 +1737,31 @@ bus_ibus_impl_context_request_rotate_eng
-         next_desc = (IBusEngineDesc*) p->data;
-     }
-     else {
-+#if USE_BRIDGE_HOTKEY
-+        if (use_bridge_hotkey (ibus) && ibus->register_engine_list) {
-+            next_desc = (IBusEngineDesc *) ibus->register_engine_list->data;
-+        }
-+#else
-         if (ibus->register_engine_list) {
-             next_desc = (IBusEngineDesc *) ibus->register_engine_list->data;
-         }
-+#endif
-         else if (ibus->engine_list) {
-             next_desc = (IBusEngineDesc *) ibus->engine_list->data;
-         }
-     }
- 
-+#if USE_BRIDGE_HOTKEY
-+    if (use_bridge_hotkey (ibus) && desc != next_desc) {
-+        bus_input_context_set_prev_hotkey_engine (context, desc);
-+        if (desc != NULL &&
-+            g_ascii_strncasecmp (ibus_engine_desc_get_name (desc),
-+                                 DEFAULT_BRIDGE_ENGINE_NAME,
-+                                 strlen (DEFAULT_BRIDGE_ENGINE_NAME)) == 0) {
-+            _update_hotkeys_by_prev_engine_desc (ibus, desc, next_desc);
-+        }
-+    }
-+#endif
-     bus_ibus_impl_set_context_engine_from_desc (ibus, context, next_desc);
- }
- 
-@@ -1387,7 +1783,9 @@ bus_ibus_impl_context_request_previous_e
-         if (!ibus->global_previous_engine_name) {
-             ibus->global_previous_engine_name = bus_ibus_impl_load_global_previous_engine_name_from_config (ibus);
-         }
-+#if 0
-         engine_name = ibus->global_previous_engine_name;
-+#endif
-         if (engine_name != NULL) {
-             /* If the previous engine is removed from the engine list or the
-                current engine and the previous engine are the same one, force
-@@ -1448,6 +1846,9 @@ bus_ibus_impl_set_focused_context (BusIB
- 
-     BusEngineProxy *engine = NULL;
-     gboolean is_enabled = FALSE;
-+#if USE_BRIDGE_HOTKEY
-+    IBusEngineDesc *desc = NULL;
-+#endif
- 
-     if (ibus->focused_context) {
-         if (ibus->use_global_engine) {
-@@ -1455,6 +1856,9 @@ bus_ibus_impl_set_focused_context (BusIB
-             engine = bus_input_context_get_engine (ibus->focused_context);
-             if (engine) {
-                 is_enabled = bus_input_context_is_enabled (ibus->focused_context);
-+#if USE_BRIDGE_HOTKEY
-+                desc = bus_input_context_get_prev_hotkey_engine (ibus->focused_context);
-+#endif
-                 g_object_ref (engine);
-                 bus_input_context_set_engine (ibus->focused_context, NULL);
-             }
-@@ -1479,6 +1883,9 @@ bus_ibus_impl_set_focused_context (BusIB
-             if (is_enabled) {
-                 bus_input_context_enable (context);
-             }
-+#if USE_BRIDGE_HOTKEY
-+            bus_input_context_set_prev_hotkey_engine (ibus->focused_context, desc);
-+#endif
-             g_object_unref (engine);
-         }
- 
-@@ -1708,6 +2115,25 @@ _context_disabled_cb (BusInputContext   
- }
- 
- /**
-+ * _context_set_xkb_engines_cb:
-+ *
-+ * A callback function to be called when the "set-xkb-engines" signal is sent to the context.
-+ */
-+static void
-+_context_set_xkb_engines_cb (BusInputContext    *context,
-+                             GList              *list,
-+                             BusIBusImpl        *ibus)
-+{
-+    if (list == NULL) {
-+        return;
-+    }
-+
-+#if USE_BRIDGE_HOTKEY
-+    ibus->xkb_group_length = g_list_length (list);
-+#endif
-+}
-+
-+/**
-  * bus_ibus_impl_create_input_context:
-  * @client: A name of a client. e.g. "gtk-im"
-  * @returns: A BusInputContext object.
-@@ -1735,6 +2161,7 @@ bus_ibus_impl_create_input_context (BusI
-         { "destroy",        G_CALLBACK (_context_destroy_cb) },
-         { "enabled",        G_CALLBACK (_context_enabled_cb) },
-         { "disabled",       G_CALLBACK (_context_disabled_cb) },
-+        { "set-xkb-engines", G_CALLBACK (_context_set_xkb_engines_cb) },
-     };
- 
-     gint i;
-@@ -2312,6 +2739,9 @@ bus_ibus_impl_filter_keyboard_shortcuts 
- 
-     GQuark event;
-     GList *engine_list;
-+#if USE_BRIDGE_HOTKEY
-+    IBusEngineDesc *prev_hotkey_engine = NULL;
-+#endif
- 
-     if (trigger == 0) {
-         trigger = g_quark_from_static_string ("trigger");
-@@ -2377,6 +2807,12 @@ bus_ibus_impl_filter_keyboard_shortcuts 
-         return FALSE;
-     }
- 
-+#if USE_BRIDGE_HOTKEY
-+    if (!use_bridge_hotkey (ibus)) {
-+        return FALSE;
-+    }
-+#endif
-+
-     /* Then try engines hotkeys. */
-     event = ibus_hotkey_profile_filter_key_event (ibus->engines_hotkey_profile,
-                                                   keyval,
-@@ -2398,6 +2834,24 @@ bus_ibus_impl_filter_keyboard_shortcuts 
- 
-         g_assert (new_engine_desc);
- 
-+#if USE_BRIDGE_HOTKEY
-+        if (context) {
-+            prev_hotkey_engine = bus_input_context_get_prev_hotkey_engine (context);
-+            if (prev_hotkey_engine == NULL && ibus->prev_hotkey_engine) {
-+                prev_hotkey_engine = ibus->prev_hotkey_engine;
-+                bus_input_context_set_prev_hotkey_engine (context,
-+                                                          prev_hotkey_engine);
-+            }
-+        }
-+
-+        /* If the previous engine is not included in engine_list,
-+         * this enables a new engine instead of toggling the engines
-+         * so should not enable the previous engine. */
-+        if (prev_hotkey_engine &&
-+            g_list_find (engine_list, prev_hotkey_engine) != NULL) {
-+            new_engine_desc = prev_hotkey_engine;
-+        }
-+#else
-         /* Find out what engine we should switch to. If the current engine has
-          * the same hotkey, then we should switch to the next engine with the
-          * same hotkey in the list. Otherwise, we just switch to the first
-@@ -2409,8 +2863,43 @@ bus_ibus_impl_filter_keyboard_shortcuts 
-                 break;
-             }
-         }
-+#endif
-+
-+#if USE_BRIDGE_HOTKEY
-+        if (context == NULL) {
-+            return FALSE;
-+        }
-+
-+        /* This means RequestEngine signal might be done but SetEngine signal
-+         * has not been done yet by ibus status icon. */
-+        if (current_engine_desc == NULL &&
-+            !bus_input_context_inited_engine (context)) {
-+            return FALSE;
-+        }
- 
-         if (current_engine_desc != new_engine_desc) {
-+            if (current_engine_desc) {
-+                if (context) {
-+                    bus_input_context_set_prev_hotkey_engine (context,
-+                                                              current_engine_desc);
-+                }
-+            }
-+
-+            /* If the current engine is the defualt bridge engine,
-+             * the current engine is not included in engine_list.
-+             * E.g. prev is Ctrl+space and Zenaku and current is Ctrl+space.
-+             * So the engine is added here. */
-+            if (current_engine_desc != NULL &&
-+                g_ascii_strncasecmp (ibus_engine_desc_get_name (current_engine_desc),
-+                                     DEFAULT_BRIDGE_ENGINE_NAME,
-+                                     strlen (DEFAULT_BRIDGE_ENGINE_NAME)) == 0) {
-+                _update_hotkeys_by_prev_engine_desc (ibus,
-+                                                     current_engine_desc,
-+                                                     new_engine_desc);
-+            }
-+#else
-+        if (current_engine_desc != new_engine_desc) {
-+#endif
-             bus_ibus_impl_set_context_engine_from_desc (ibus, context, new_engine_desc);
-         }
- 
-@@ -2514,59 +3003,54 @@ static void
- _add_engine_hotkey (IBusEngineDesc *engine, BusIBusImpl *ibus)
- {
-     const gchar *hotkeys;
--    gchar **hotkey_list;
--    gchar **p;
--    gchar *hotkey;
--    GList *engine_list;
--
--    GQuark event;
--    guint keyval;
--    guint modifiers;
- 
-     if (!engine) {
-         return;
-     }
- 
--    hotkeys = ibus_engine_desc_get_hotkeys (engine);
--
--    if (!hotkeys || !*hotkeys) {
-+#if USE_BRIDGE_HOTKEY
-+    if (!use_bridge_hotkey (ibus)) {
-         return;
-     }
- 
--    hotkey_list = g_strsplit_set (hotkeys, ";,", 0);
--
--    for (p = hotkey_list; p && *p; ++p) {
--        hotkey = g_strstrip (*p);
--        if (!*hotkey || !ibus_key_event_from_string (hotkey, &keyval, &modifiers)) {
--            continue;
--        }
--
--        /* If the hotkey already exists, we won't need to add it again. */
--        event = ibus_hotkey_profile_lookup_hotkey (ibus->engines_hotkey_profile,
--                                                   keyval, modifiers);
--        if (event == 0) {
--            event = g_quark_from_string (hotkey);
--            ibus_hotkey_profile_add_hotkey (ibus->engines_hotkey_profile,
--                                            keyval, modifiers, event);
--        }
-+    /* Do not register hotkeys for the default keymap engines
-+     * but register hotkeys for only input-method engines
-+     * in 'RegisterComponent' dbus method.
-+     * The hotkeys for an activated keymap engine will be registered
-+     * in 'SetEngine' dbus method. */
-+    if (g_ascii_strncasecmp (ibus_engine_desc_get_name (engine),
-+                             DEFAULT_BRIDGE_ENGINE_NAME,
-+                             strlen (DEFAULT_BRIDGE_ENGINE_NAME)) == 0) {
-+        return;
-+    }
- 
--        engine_list = g_hash_table_lookup (ibus->hotkey_to_engines_map,
--                                           GUINT_TO_POINTER (event));
-+    /* If the user customized the trigger key, the trigger key is used for
-+     * any IBus engines. */
-+    if (_bridge_trigger_keys != NULL &&
-+        *_bridge_trigger_keys != '\0' &&
-+        g_strcmp0 (_bridge_trigger_keys, "Control+space") != 0) {
- 
--        /* As we will rebuild the engines hotkey map whenever an engine was
--         * added or removed, we don't need to hold a reference of the engine
--         * here. */
--        engine_list = g_list_append (engine_list, engine);
-+        hotkeys = (const gchar *) _bridge_trigger_keys;
-+    } else {
-+        hotkeys = ibus_engine_desc_get_hotkeys (engine);
-+    }
-+#else
-+    hotkeys = ibus_engine_desc_get_hotkeys (engine);
-+#endif
- 
--        /* We need to steal the value before adding it back, otherwise it will
--         * be destroyed. */
--        g_hash_table_steal (ibus->hotkey_to_engines_map, GUINT_TO_POINTER (event));
-+#if USE_BRIDGE_HOTKEY
-+    /* If engine hotkeys are not defined in the compose xml file, IBus trigger
-+     * keys are used. */
-+    if (!hotkeys || !*hotkeys) {
-+        hotkeys = (const gchar *) _bridge_trigger_keys;
-+    }
-+#endif
- 
--        g_hash_table_insert (ibus->hotkey_to_engines_map,
--                             GUINT_TO_POINTER (event), engine_list);
-+    if (!hotkeys || !*hotkeys) {
-+        return;
-     }
- 
--    g_strfreev (hotkey_list);
-+    _add_engine_hotkey_with_hotkeys (engine, ibus, hotkeys);
- }
- 
- /**
-diff --git a/bus/inputcontext.c b/bus/inputcontext.c
-index 3c81688..58ab8f4 100644
---- a/bus/inputcontext.c
-+++ b/bus/inputcontext.c
-@@ -90,6 +90,12 @@ struct _BusInputContext {
- 
-     /* incompleted set engine by desc request */
-     SetEngineByDescData *data;
-+
-+    /* if init engine */
-+    gboolean inited_engine;
-+
-+    /* previous hotkey engine for bridge hotkey mode */
-+    IBusEngineDesc *prev_hotkey_engine;
- };
- 
- struct _BusInputContextClass {
-@@ -122,6 +128,7 @@ enum {
-     DISABLED,
-     ENGINE_CHANGED,
-     REQUEST_ENGINE,
-+    SET_XKB_ENGINES,
-     LAST_SIGNAL,
- };
- 
-@@ -265,6 +272,9 @@ static const gchar introspection_xml[] =
-     "    <method name='GetEngine'>"
-     "      <arg direction='out' type='v' name='desc' />"
-     "    </method>"
-+    "    <method name='SetXKBEngines'>"
-+    "      <arg direction='in' type='av' name='engines' />"
-+    "    </method>"
-     "    <method name='SetSurroundingText'>"
-     "      <arg direction='in' type='v' name='text' />"
-     "      <arg direction='in' type='u' name='cursor_pos' />"
-@@ -586,6 +596,17 @@ bus_input_context_class_init (BusInputContextClass *class)
-             1,
-             G_TYPE_STRING);
- 
-+    context_signals[SET_XKB_ENGINES] =
-+        g_signal_new (I_("set-xkb-engines"),
-+            G_TYPE_FROM_CLASS (class),
-+            G_SIGNAL_RUN_LAST,
-+            0,
-+            NULL, NULL,
-+            bus_marshal_VOID__OBJECT,
-+            G_TYPE_NONE,
-+            1,
-+            G_TYPE_POINTER);
-+
-     text_empty = ibus_text_new_from_string ("");
-     g_object_ref_sink (text_empty);
-     lookup_table_empty = ibus_lookup_table_new (9 /* page size */, 0, FALSE, FALSE);
-@@ -648,6 +669,11 @@ bus_input_context_destroy (BusInputContext *context)
-         context->client = NULL;
-     }
- 
-+    if (context->prev_hotkey_engine) {
-+        g_object_unref (context->prev_hotkey_engine);
-+        context->prev_hotkey_engine = NULL;
-+    }
-+
-     IBUS_OBJECT_CLASS (bus_input_context_parent_class)->destroy (IBUS_OBJECT (context));
- }
- 
-@@ -1048,6 +1074,32 @@ _ic_get_engine (BusInputContext       *context,
- }
- 
- /**
-+ * _ic_set_xkb_engines:
-+ *
-+ * Implement the "SetXKBEngines" method call of the org.freedesktop.IBus.InputContext interface.
-+ */
-+static void
-+_ic_set_xkb_engines (BusInputContext       *context,
-+                     GVariant              *parameters,
-+                     GDBusMethodInvocation *invocation)
-+{
-+    GVariantIter *iter = NULL;
-+    GVariant *var;
-+    GList *list = NULL;
-+
-+    g_variant_get_child (parameters, 0, "av", &iter);
-+    while (g_variant_iter_loop (iter, "v", &var)) {
-+        list = g_list_append (list, ibus_serializable_deserialize (var));
-+    }
-+    g_variant_iter_free (iter);
-+
-+    g_signal_emit (context,
-+                   context_signals[SET_XKB_ENGINES], 0,
-+                   list);
-+    return;
-+}
-+
-+/**
-  * bus_input_context_service_method_call:
-  *
-  * Handle a D-Bus method call whose destination and interface name are both "org.freedesktop.IBus.InputContext"
-@@ -1126,6 +1178,7 @@ bus_input_context_service_method_call (IBusService            *service,
-         { "IsEnabled",         _ic_is_enabled },
-         { "SetEngine",         _ic_set_engine },
-         { "GetEngine",         _ic_get_engine },
-+        { "SetXKBEngines",     _ic_set_xkb_engines },
-         { "SetSurroundingText", _ic_set_surrounding_text},
-     };
- 
-@@ -2218,6 +2271,7 @@ bus_input_context_set_engine (BusInputContext *context,
-     }
-     else {
-         gint i;
-+        context->inited_engine = TRUE;
-         context->engine = engine;
-         g_object_ref (context->engine);
- 
-@@ -2542,3 +2596,30 @@ bus_input_context_get_client (BusInputContext *context)
-     g_assert (BUS_IS_INPUT_CONTEXT (context));
-     return context->client;
- }
-+
-+gboolean
-+bus_input_context_inited_engine (BusInputContext *context)
-+{
-+    g_assert (BUS_IS_INPUT_CONTEXT (context));
-+    return context->inited_engine;
-+}
-+
-+IBusEngineDesc *
-+bus_input_context_get_prev_hotkey_engine (BusInputContext *context)
-+{
-+    g_assert (BUS_IS_INPUT_CONTEXT (context));
-+    return context->prev_hotkey_engine;
-+}
-+
-+void
-+bus_input_context_set_prev_hotkey_engine (BusInputContext *context,
-+                                          IBusEngineDesc  *desc)
-+{
-+    g_assert (BUS_IS_INPUT_CONTEXT (context));
-+    g_assert (desc == NULL || IBUS_IS_ENGINE_DESC (desc));
-+
-+    if (context->prev_hotkey_engine) {
-+        g_object_unref (context->prev_hotkey_engine);
-+    }
-+    context->prev_hotkey_engine = desc ? g_object_ref (desc) : NULL;
-+}
-diff --git a/bus/inputcontext.h b/bus/inputcontext.h
-index bc4e096..c79e033 100644
---- a/bus/inputcontext.h
-+++ b/bus/inputcontext.h
-@@ -213,5 +213,27 @@ void                 bus_input_context_set_capabilities (BusInputContext    *con
-  */
- const gchar         *bus_input_context_get_client       (BusInputContext    *context);
- 
-+/**
-+ * bus_input_context_inited_engine:
-+ * @returns: context->inited_engine.
-+ */
-+gboolean             bus_input_context_inited_engine
-+                                                        (BusInputContext *context);
-+
-+/**
-+ * bus_input_context_get_prev_hotkey_engine:
-+ * @returns: context->prev_hotkey_engine.
-+ */
-+IBusEngineDesc      *bus_input_context_get_prev_hotkey_engine
-+                                                        (BusInputContext *context);
-+
-+/**
-+ * bus_input_context_set_prev_hotkey_engine:
-+ * @desc: Assign the desc to context->prev_hotkey_engine.
-+ */
-+void                 bus_input_context_set_prev_hotkey_engine
-+                                                        (BusInputContext *context,
-+                                                         IBusEngineDesc  *desc);
-+
- G_END_DECLS
- #endif
-diff --git a/bus/registry.c b/bus/registry.c
-index 7b74781..28e2abf 100644
---- a/bus/registry.c
-+++ b/bus/registry.c
-@@ -19,6 +19,11 @@
-  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-  * Boston, MA 02111-1307, USA.
-  */
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
- #include "registry.h"
- #include <glib/gstdio.h>
- #include <gio/gio.h>
-@@ -101,6 +106,9 @@ bus_registry_init (BusRegistry *registry)
-     registry->observed_paths = NULL;
-     registry->components = NULL;
-     registry->engine_table = g_hash_table_new (g_str_hash, g_str_equal);
-+#if USE_BRIDGE_HOTKEY
-+    gboolean has_default_engine = FALSE;
-+#endif
- 
- #ifdef G_THREADS_ENABLED
-     /* If glib supports thread, we'll create a thread to monitor changes in IME
-@@ -145,12 +153,40 @@ bus_registry_init (BusRegistry *registry)
-         GList *p1;
-         for (p1 = engines; p1 != NULL; p1 = p1->next) {
-             IBusEngineDesc *desc = (IBusEngineDesc *) p1->data;
-+#if USE_BRIDGE_HOTKEY
-+            if (g_ascii_strncasecmp (ibus_engine_desc_get_name (desc),
-+                                     DEFAULT_BRIDGE_ENGINE_NAME,
-+                                     strlen (DEFAULT_BRIDGE_ENGINE_NAME)) == 0) {
-+                has_default_engine = TRUE;
-+            }
-+#endif
-             g_hash_table_insert (registry->engine_table,
-                                  (gpointer) ibus_engine_desc_get_name (desc),
-                                  desc);
-         }
-         g_list_free (engines);
-     }
-+
-+#if USE_BRIDGE_HOTKEY
-+    if (has_default_engine == FALSE) {
-+        bus_registry_remove_all (registry);
-+        bus_registry_load (registry);
-+        bus_registry_save_cache (registry);
-+
-+        for (p = registry->components; p != NULL; p = p->next) {
-+            BusComponent *comp = (BusComponent *) p->data;
-+            GList *engines = bus_component_get_engines (comp);
-+            GList *p1;
-+            for (p1 = engines; p1 != NULL; p1 = p1->next) {
-+                IBusEngineDesc *desc = (IBusEngineDesc *) p1->data;
-+                g_hash_table_insert (registry->engine_table,
-+                                     (gpointer) ibus_engine_desc_get_name (desc),
-+                                     desc);
-+            }
-+            g_list_free (engines);
-+        }
-+    }
-+#endif
- }
- 
- static void
-@@ -516,6 +552,31 @@ bus_registry_get_engines_by_language (BusRegistry *registry,
-     return engines;
- }
- 
-+GList *
-+bus_registry_get_engines_by_name_prefix (BusRegistry *registry,
-+                                         const gchar *name_prefix)
-+{
-+    GList *p1, *p2;
-+    GList *engines = NULL;
-+
-+    g_assert (BUS_IS_REGISTRY (registry));
-+    g_assert (name_prefix);
-+
-+    p1 = bus_registry_get_engines (registry);
-+
-+    for (p2 = p1; p2 != NULL; p2 = p2->next) {
-+        IBusEngineDesc *desc = (IBusEngineDesc *) p2->data;
-+        if (g_ascii_strncasecmp (ibus_engine_desc_get_name (desc),
-+                                 name_prefix,
-+                                 strlen (name_prefix)) == 0) {
-+            engines = g_list_append (engines, desc);
-+        }
-+    }
-+
-+    g_list_free (p1);
-+    return engines;
-+}
-+
- IBusEngineDesc *
- bus_registry_find_engine_by_name (BusRegistry *registry,
-                                   const gchar *name)
-diff --git a/bus/registry.h b/bus/registry.h
-index cdabec0..721187c 100644
---- a/bus/registry.h
-+++ b/bus/registry.h
-@@ -73,6 +73,16 @@ GList           *bus_registry_get_engines_by_language
-                                                  const gchar    *language);
- 
- /**
-+ * bus_registry_get_engines_by_name_prefix:
-+ * @name_prefix: a prefix in the name of IBusEngineDesc. 
-+ * @returns: a list of IBusEngineDesc objects which has the name prefix.
-+ *           The caller has to call g_list_free for the returned list.
-+ */
-+GList           *bus_registry_get_engines_by_name_prefix
-+                                                (BusRegistry    *registry,
-+                                                 const gchar    *name_prefix);
-+
-+/**
-  * bus_registry_stop_all_components:
-  *
-  * Terminate all component processes.
-diff --git a/configure.ac b/configure.ac
-index 227e28e..788fbef 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -483,6 +483,34 @@ else
-     enable_surrounding_text="no (disabled, use --enable-surrounding-text to enable)"
- fi
- 
-+# Option for bridge hotkey
-+AC_ARG_ENABLE(bridge-hotkey,
-+    AS_HELP_STRING([--enable-bridge-hotkey],
-+        [Enable bridge hotkey instead of ON/OFF hotkey]),
-+    [enable_bridge_hotkey=$enableval],
-+    [enable_bridge_hotkey=no]
-+)
-+
-+if test x"$enable_bridge_hotkey" = x"yes"; then
-+    USE_BRIDGE_HOTKEY=1
-+    TRIGGER_HOTKEYS="Control+space"
-+else
-+    USE_BRIDGE_HOTKEY=0
-+    TRIGGER_HOTKEYS="Control+space,Zenkaku_Hankaku,Alt+Kanji,Alt+grave,Hangul,Alt+Release+Alt_R"
-+    enable_bridge_hotkey="no (disabled, use --enable-bridge-hotkey to enable)"
-+fi
-+AC_SUBST(USE_BRIDGE_HOTKEY)
-+AC_SUBST(TRIGGER_HOTKEYS)
-+
-+# Define default bridge engine name
-+AC_ARG_WITH(bridge-engine,
-+    AS_HELP_STRING([--with-bridge-engine[=bridge_engine_name]],
-+        [Set bridge engine name in IM bridge hotkey. (default: xkb:layout:default:)]),
-+    [DEFAULT_BRIDGE_ENGINE_NAME=$with_bridge_engine],
-+    [DEFAULT_BRIDGE_ENGINE_NAME="xkb:layout:default:"]
-+)
-+AC_SUBST(DEFAULT_BRIDGE_ENGINE_NAME)
-+
- # Check iso-codes.
- PKG_CHECK_MODULES(ISOCODES, [
-     iso-codes
-@@ -509,6 +537,7 @@ bus/Makefile
- util/Makefile
- util/IMdkit/Makefile
- data/Makefile
-+data/ibus.schemas.in
- data/icons/Makefile
- data/keymaps/Makefile
- data/dconf/Makefile
-@@ -561,5 +590,7 @@ Build options:
-   No snooper regexes        "$NO_SNOOPER_APPS"
-   Panel icon                "$IBUS_ICON_KEYBOARD"
-   Enable surrounding-text   $enable_surrounding_text
-+  Enable bridge hotkey      $enable_bridge_hotkey
-+  Default bridge engine     $DEFAULT_BRIDGE_ENGINE_NAME
- ])
- 
-diff --git a/data/Makefile.am b/data/Makefile.am
-index 99be41c..824da76 100644
---- a/data/Makefile.am
-+++ b/data/Makefile.am
-@@ -30,7 +30,8 @@ SUBDIRS += dconf
- endif
- 
- schemasdir = $(GCONF_SCHEMA_FILE_DIR)
--schemas_in_files = ibus.schemas.in
-+schemas_in_in_files = ibus.schemas.in.in
-+schemas_in_files = $(schemas_in_in_files:.schemas.in.in=.schemas.in)
- schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
- @INTLTOOL_SCHEMAS_RULE@
- 
-@@ -45,11 +46,12 @@ if GCONF_SCHEMAS_INSTALL
- endif
- 
- EXTRA_DIST = \
--	$(schemas_in_files) \
-+	$(schemas_in_in_files) \
- 	$(NULL)
- 
- DISTCLEANFILES = \
- 	$(schemas_DATA) \
-+	$(schemas_in_files) \
- 	$(NULL)
- 
- -include $(top_srcdir)/git.mk
-diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in.in
-index 8979515..2a2b459
---- a/data/ibus.schemas.in
-+++ b/data/ibus.schemas.in.in
-@@ -31,7 +31,7 @@
-       <owner>ibus</owner>
-       <type>list</type>
-       <list_type>string</list_type>
--      <default>[Control+space,Zenkaku_Hankaku,Alt+Kanji,Alt+grave,Hangul,Alt+Release+Alt_R]</default>
-+      <default>[@TRIGGER_HOTKEYS@]</default>
-       <locale name="C">
-         <short>Trigger shortcut keys</short>
- 	    <long>The shortcut keys for turning input method on or off</long>
-@@ -103,6 +103,19 @@
-       </locale>
-     </schema>
-     <schema>
-+      <key>/schemas/desktop/ibus/general/hotkey/use_bridge_hotkey</key>
-+      <applyto>/desktop/ibus/general/hotkey/use_bridge_hotkey</applyto>
-+      <owner>ibus</owner>
-+      <type>bool</type>
-+      <default>true</default>
-+      <locale name="C">
-+        <short>Use bridge hotkey</short>
-+	    <long>Use trigger keys to toggle the prev and next IM engines
-+                  if true. Use trigger keys to toggle an enable and 
-+                  disabled IM engine if false.</long>
-+      </locale>
-+    </schema>
-+    <schema>
-       <key>/schemas/desktop/ibus/panel/show</key>
-       <applyto>/desktop/ibus/panel/show</applyto>
-       <owner>ibus</owner>
-diff --git a/ibus/_config.py.in b/ibus/_config.py.in
-index a830136..4c3c980 100644
---- a/ibus/_config.py.in
-+++ b/ibus/_config.py.in
-@@ -25,6 +25,8 @@ __all__ = (
-     "get_copyright",
-     "get_license",
-     "get_ICON_KEYBOARD",
-+    "use_bridge_hotkey",
-+    "DEFAULT_BRIDGE_ENGINE_NAME",
-     "ISOCODES_PREFIX",
-     "_"
- )
-@@ -55,4 +57,8 @@ def get_ICON_KEYBOARD():
-         return fallback_icon
-     return icon
- 
-+def use_bridge_hotkey():
-+    return True if @USE_BRIDGE_HOTKEY@ == 1 else False
-+
-+DEFAULT_BRIDGE_ENGINE_NAME='@DEFAULT_BRIDGE_ENGINE_NAME@'
- ISOCODES_PREFIX='@ISOCODES_PREFIX@'
-diff --git a/ibus/inputcontext.py b/ibus/inputcontext.py
-index 64a6ba2..b471e20 100644
---- a/ibus/inputcontext.py
-+++ b/ibus/inputcontext.py
-@@ -28,6 +28,7 @@ import sys
- import gobject
- import dbus
- import dbus.lowlevel
-+import _config
- import object
- import common
- import serializable
-@@ -283,8 +284,22 @@ class InputContext(object.Object):
-         except:
-             return None
- 
-+    def __handle_ic_reply(self):
-+        pass
-+
-+    def __handle_ic_error(self, e):
-+        print self.__gtype_name__, str(e)
-+
-     def set_engine(self, engine):
--        return self.__context.SetEngine(engine.name)
-+        return self.__context.SetEngine(engine.name,
-+                                        reply_handler=self.__handle_ic_reply,
-+                                        error_handler=self.__handle_ic_error)
-+
-+    def set_xkb_engines(self, engines):
-+        engines = map(lambda e: serializable.serialize_object(e), engines)
-+        return self.__context.SetXKBEngines(engines,
-+                                            reply_handler=self.__handle_ic_reply,
-+                                            error_handler=self.__handle_ic_error)
- 
-     def introspect(self):
-         return self.__context.Introspect()
-diff --git a/ibus/interface/iinputcontext.py b/ibus/interface/iinputcontext.py
-index 06ce519..3b655dc 100644
---- a/ibus/interface/iinputcontext.py
-+++ b/ibus/interface/iinputcontext.py
-@@ -76,8 +76,11 @@ class IInputContext(dbus.service.Object):
-     @method(out_signature="v")
-     def GetEngine(self): pass
- 
--    @method(in_signature="s")
--    def SetEngine(self, engine_name): pass
-+    @async_method(in_signature="s")
-+    def SetEngine(self, engine_name, reply_cb, error_cb): pass
-+
-+    @async_method(in_signature="av")
-+    def SetXKBEngines(self, engines, reply_cb, error_cb): pass
- 
-     @method()
-     def Destroy(self): pass
-diff --git a/ibus/xkbxml.py.in b/ibus/xkbxml.py.in
-index 9407c13..bf61810 100644
---- a/ibus/xkbxml.py.in
-+++ b/ibus/xkbxml.py.in
-@@ -33,6 +33,8 @@ import enginedesc
- from xml.sax.saxutils import XMLFilterBase, XMLGenerator
- from xml.sax._exceptions import SAXParseException
- from cStringIO import StringIO
-+from _config import DEFAULT_BRIDGE_ENGINE_NAME
-+from _config import get_ICON_KEYBOARD
- 
- try:
-     from glib import get_user_config_dir
-@@ -315,6 +317,8 @@ class XKBConfigRegistry():
-             engine_layout = layout
- 
-         icon = 'ibus-engine'
-+        if name.startswith(DEFAULT_BRIDGE_ENGINE_NAME):
-+            icon = get_ICON_KEYBOARD()
- 
-         engine = enginedesc.EngineDesc(name, longname, desc, lang,
-                                        'LGPL2.1',
-diff --git a/setup/enginecombobox.py b/setup/enginecombobox.py
-index 7383177..d35757d 100644
---- a/setup/enginecombobox.py
-+++ b/setup/enginecombobox.py
-@@ -64,6 +64,9 @@ class EngineComboBox(gtk.ComboBox):
-         self.__model.set(iter1, 0, 0)
-         lang = {}
-         for e in engines:
-+            if ibus.use_bridge_hotkey() and \
-+               e.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
-+                continue
-             l = ibus.get_language_name(e.language)
-             if l not in lang:
-                 lang[l] = []
-diff --git a/setup/enginetreeview.py b/setup/enginetreeview.py
-index f620361..664dc99 100644
---- a/setup/enginetreeview.py
-+++ b/setup/enginetreeview.py
-@@ -172,8 +172,12 @@ class EngineTreeView(gtk.TreeView):
-         for e in engines:
-             if e in self.__engines:
-                 continue
--            iter = self.__model.append(None)
--            self.__model.set(iter, 0, e)
-+            if ibus.use_bridge_hotkey() and \
-+               e.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
-+                pass
-+            else:
-+                iter = self.__model.append(None)
-+                self.__model.set(iter, 0, e)
-             self.__engines.add(e)
-         self.__emit_changed()
- 
-diff --git a/setup/main.py b/setup/main.py
-index 7f4a040..a773944 100644
---- a/setup/main.py
-+++ b/setup/main.py
-@@ -213,6 +213,22 @@ class Setup(object):
-             self.__config.get_value("general", "use_global_engine", False))
-         self.__checkbutton_use_global_engine.connect("toggled", self.__checkbutton_use_global_engine_toggled_cb)
- 
-+        # hotkey settings
-+        if ibus.use_bridge_hotkey():
-+            self.__set_bridge_hotkey_labels()
-+            self.__checkbutton_use_on_off_hotkey = \
-+                self.__builder.get_object("checkbutton_use_on_off_hotkey")
-+            self.__checkbutton_use_on_off_hotkey.set_active(
-+                not self.__config.get_value("general/hotkey",
-+                                            "use_bridge_hotkey",
-+                                            True))
-+            self.__checkbutton_use_on_off_hotkey.connect("toggled",
-+                self.__checkbutton_use_on_off_hotkey_cb)
-+        else:
-+            checkbutton = self.__builder.get_object("checkbutton_use_on_off_hotkey")
-+            checkbutton.hide()
-+            checkbutton.set_no_show_all(True)
-+
-         # init engine page
-         preload_engine_mode = self.__config.get_value("general",
-                                                       "preload_engine_mode",
-@@ -519,6 +535,35 @@ class Setup(object):
-         value = self.__checkbutton_use_global_engine.get_active()
-         self.__config.set_value("general", "use_global_engine", value)
- 
-+    def __checkbutton_use_on_off_hotkey_cb(self, button):
-+        value = self.__checkbutton_use_on_off_hotkey.get_active()
-+        self.__config.set_value("general/hotkey", "use_bridge_hotkey",
-+                                not value)
-+        self.__set_bridge_hotkey_labels()
-+
-+    def __set_bridge_hotkey_labels(self):
-+        label = self.__builder.get_object("label_trigger_hotkey")
-+        label_enable = self.__builder.get_object("label_enable")
-+        hbox_enable = self.__builder.get_object("hbox_enable")
-+        label_disable = self.__builder.get_object("label_disable")
-+        hbox_disable = self.__builder.get_object("hbox_disable")
-+        if self.__config.get_value("general/hotkey", "use_bridge_hotkey", True):
-+            label.set_label(_("Toggle input methods:"))
-+            label.set_tooltip_text(_("The shortcut keys to toggle "
-+                                     "the previous and next input methods"))
-+            label_enable.hide()
-+            hbox_enable.hide()
-+            label_disable.hide()
-+            hbox_disable.hide()
-+        else:
-+            label.set_label(_("Enable or disable:"))
-+            label.set_tooltip_text(_("The shortcut keys for turning "
-+                                     "input method on or off"))
-+            label_enable.show()
-+            hbox_enable.show()
-+            label_disable.show()
-+            hbox_disable.show()
-+
-     def __config_value_changed_cb(self, bus, section, name, value):
-         if section == 'general' and name == 'preload_engines':
-             engines = self.__get_engine_descs_from_names(value)
-diff --git a/setup/setup.ui b/setup/setup.ui
-index f1e6d0b..671b84c 100644
---- a/setup/setup.ui
-+++ b/setup/setup.ui
-@@ -100,6 +100,7 @@
-                                 <property name="n_columns">2</property>
-                                 <property name="column_spacing">12</property>
-                                 <property name="row_spacing">6</property>
-+                                <property name="no_show_all">True</property>
-                                 <child>
-                                   <object class="GtkLabel" id="label8">
-                                     <property name="visible">True</property>
-@@ -232,7 +233,7 @@
-                                   </packing>
-                                 </child>
-                                 <child>
--                                  <object class="GtkLabel" id="label7">
-+                                  <object class="GtkLabel" id="label_trigger_hotkey">
-                                     <property name="visible">True</property>
-                                     <property name="tooltip_text" translatable="yes">The shortcut keys for turning input method on or off</property>
-                                     <property name="xalign">0</property>
-@@ -244,7 +245,7 @@
-                                   </packing>
-                                 </child>
-                                 <child>
--                                  <object class="GtkLabel" id="label18">
-+                                  <object class="GtkLabel" id="label_enable">
-                                     <property name="visible">True</property>
-                                     <property name="xalign">0</property>
-                                     <property name="label" translatable="yes">Enable:</property>
-@@ -257,7 +258,7 @@
-                                   </packing>
-                                 </child>
-                                 <child>
--                                  <object class="GtkHBox" id="hbox2">
-+                                  <object class="GtkHBox" id="hbox_enable">
-                                     <property name="visible">True</property>
-                                     <property name="spacing">6</property>
-                                     <child>
-@@ -292,7 +293,7 @@
-                                   </packing>
-                                 </child>
-                                 <child>
--                                  <object class="GtkLabel" id="label19">
-+                                  <object class="GtkLabel" id="label_disable">
-                                     <property name="visible">True</property>
-                                     <property name="xalign">0</property>
-                                     <property name="label" translatable="yes">Disable:</property>
-@@ -305,7 +306,7 @@
-                                   </packing>
-                                 </child>
-                                 <child>
--                                  <object class="GtkHBox" id="hbox3">
-+                                  <object class="GtkHBox" id="hbox_disable">
-                                     <property name="visible">True</property>
-                                     <property name="spacing">6</property>
-                                     <child>
-@@ -962,6 +963,59 @@ You may use up/down buttons to change it.&lt;/i&gt;&lt;/small&gt;</property>
-                         <property name="position">1</property>
-                       </packing>
-                     </child>
-+                    <child>
-+                      <object class="GtkFrame" id="frame6">
-+                        <property name="visible">True</property>
-+                        <property name="label_xalign">0</property>
-+                        <property name="shadow_type">none</property>
-+                        <child>
-+                          <object class="GtkAlignment" id="alignment14">
-+                            <property name="visible">True</property>
-+                            <property name="left_padding">12</property>
-+                            <child>
-+                              <object class="GtkAlignment" id="alignment15">
-+                                <property name="visible">True</property>
-+                                <property name="top_padding">6</property>
-+                                <property name="left_padding">12</property>
-+                                <child>
-+                                  <object class="GtkVBox" id="vbox10">
-+                                    <property name="visible">True</property>
-+                                    <property name="orientation">vertical</property>
-+                                    <property name="spacing">6</property>
-+                                    <child>
-+                                      <object class="GtkCheckButton" id="checkbutton_use_on_off_hotkey">
-+                                        <property name="label" translatable="yes">Use toggle shortcut keys to enable or disable an input method</property>
-+                                        <property name="visible">True</property>
-+                                        <property name="can_focus">True</property>
-+                                        <property name="receives_default">False</property>
-+                                        <property name="draw_indicator">True</property>
-+                                      </object>
-+                                      <packing>
-+                                        <property name="expand">False</property>
-+                                        <property name="fill">False</property>
-+                                        <property name="position">0</property>
-+                                      </packing>
-+                                    </child>
-+                                  </object>
-+                                </child>
-+                              </object>
-+                            </child>
-+                          </object>
-+                        </child>
-+                        <child type="label">
-+                          <object class="GtkLabel" id="label50">
-+                            <property name="visible">True</property>
-+                            <property name="label" translatable="yes">&lt;b&gt;Hot keys setting&lt;/b&gt;</property>
-+                            <property name="use_markup">True</property>
-+                          </object>
-+                        </child>
-+                      </object>
-+                      <packing>
-+                        <property name="expand">False</property>
-+                        <property name="fill">False</property>
-+                        <property name="position">2</property>
-+                      </packing>
-+                    </child>
-                   </object>
-                 </child>
-               </object>
-diff --git a/src/Makefile.am b/src/Makefile.am
-index 6454522..319df3c 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -38,14 +38,16 @@ INTROSPECTION_GIRS =
- CLEANFILES =
- 
- # C preprocessor flags
--AM_CPPFLAGS =                                   \
--    -DG_LOG_DOMAIN=\"IBUS\"                     \
--    @GLIB2_CFLAGS@                              \
--    @GOBJECT2_CFLAGS@                           \
--    @GIO2_CFLAGS@                               \
--    -DIBUS_DATA_DIR=\"$(pkgdatadir)\"           \
--    -DIBUS_COMPILATION                          \
--    -DISOCODES_PREFIX=\"$(ISOCODES_PREFIX)\"    \
-+AM_CPPFLAGS =                                                           \
-+    -DG_LOG_DOMAIN=\"IBUS\"                                             \
-+    @GLIB2_CFLAGS@                                                      \
-+    @GOBJECT2_CFLAGS@                                                   \
-+    @GIO2_CFLAGS@                                                       \
-+    -DIBUS_DATA_DIR=\"$(pkgdatadir)\"                                   \
-+    -DIBUS_COMPILATION                                                  \
-+    -DISOCODES_PREFIX=\"$(ISOCODES_PREFIX)\"                            \
-+    -DUSE_BRIDGE_HOTKEY=$(USE_BRIDGE_HOTKEY)                            \
-+    -DDEFAULT_BRIDGE_ENGINE_NAME=\"$(DEFAULT_BRIDGE_ENGINE_NAME)\"      \
-     $(NULL)
- 
- # ibus library
-diff --git a/src/ibushotkey.c b/src/ibushotkey.c
-index 32f8338..bef7dfc 100644
---- a/src/ibushotkey.c
-+++ b/src/ibushotkey.c
-@@ -562,3 +562,14 @@ ibus_hotkey_profile_lookup_hotkey (IBusHotkeyProfile *profile,
- 
-     return (GQuark) GPOINTER_TO_UINT (g_tree_lookup (priv->hotkeys, &hotkey));
- }
-+
-+void
-+ibus_hotkey_profile_foreach_hotkey (IBusHotkeyProfile *profile,
-+                                    GTraverseFunc      func,
-+                                    gpointer           user_data)
-+{
-+    IBusHotkeyProfilePrivate *priv;
-+    priv = IBUS_HOTKEY_PROFILE_GET_PRIVATE (profile);
-+
-+    g_tree_foreach (priv->hotkeys, func, user_data);
-+}
-diff --git a/src/ibushotkey.h b/src/ibushotkey.h
-index 9a341f6..92ec6af 100644
---- a/src/ibushotkey.h
-+++ b/src/ibushotkey.h
-@@ -179,5 +179,16 @@ GQuark           ibus_hotkey_profile_lookup_hotkey
-                                                  guint               keyval,
-                                                  guint               modifiers);
- 
-+/**
-+ * ibus_hotkey_profile_foreach_hotkey:
-+ * @profile: An IBusHotkeyProfile.
-+ * @func: (scope call): A GTraverseFunc for g_tree_traverse.
-+ * @user_data: A gpointer for g_tree_traverse.
-+ */
-+void             ibus_hotkey_profile_foreach_hotkey
-+                                                (IBusHotkeyProfile  *profile,
-+                                                 GTraverseFunc       func,
-+                                                 gpointer            user_data);
-+
- G_END_DECLS
- #endif
-diff --git a/src/ibusinputcontext.c b/src/ibusinputcontext.c
-index 54e30ae..c37a71d 100644
---- a/src/ibusinputcontext.c
-+++ b/src/ibusinputcontext.c
-@@ -1219,6 +1219,33 @@ ibus_input_context_set_engine (IBusInputContext *context,
-                        );
- }
- 
-+void
-+ibus_input_context_set_xkb_engines (IBusInputContext *context,
-+                                    GList            *list)
-+{
-+    GVariantBuilder builder;
-+    GList *p;
-+
-+    g_assert (IBUS_IS_INPUT_CONTEXT (context));
-+    g_assert (list);
-+
-+    g_variant_builder_init (&builder, G_VARIANT_TYPE ("av"));
-+    for (p = list; p; p = p->next) {
-+        g_variant_builder_add (&builder, "v",
-+                               ibus_serializable_serialize ((IBusSerializable *) p->data));
-+    }
-+
-+    g_dbus_proxy_call ((GDBusProxy *) context,
-+                       "SetXKBEngines",                     /* method_name */
-+                       g_variant_new ("(av)", &builder),    /* parameters */
-+                       G_DBUS_CALL_FLAGS_NONE,              /* flags */
-+                       -1,                                  /* timeout */
-+                       NULL,                                /* cancellable */
-+                       NULL,                                /* callback */
-+                       NULL                                 /* user_data */
-+                       );
-+}
-+
- #define DEFINE_FUNC(name, Name)                                         \
-     void                                                                \
-     ibus_input_context_##name (IBusInputContext *context)               \
-diff --git a/src/ibusinputcontext.h b/src/ibusinputcontext.h
-index be3c502..40b902e 100644
---- a/src/ibusinputcontext.h
-+++ b/src/ibusinputcontext.h
-@@ -495,6 +495,18 @@ void         ibus_input_context_set_engine  (IBusInputContext   *context,
-                                              const gchar        *name);
- 
- /**
-+ * ibus_input_context_set_xkb_engines:
-+ * @context: An IBusInputContext.
-+ * @list: (transfer container) (element-type IBusEngineDesc):
-+ *     A list of the engines.
-+ *
-+ * Set XKB group layouts from the desktop session.
-+ */
-+void         ibus_input_context_set_xkb_engines
-+                                            (IBusInputContext *context,
-+                                             GList            *list);
-+
-+/**
-  * ibus_input_context_set_surrounding_text:
-  * @context: An #IBusInputContext.
-  * @text: An #IBusText surrounding the current cursor on the application.
-diff --git a/src/ibusutil.c b/src/ibusutil.c
-index ddb6b9e..46dab1a 100644
---- a/src/ibusutil.c
-+++ b/src/ibusutil.c
-@@ -145,3 +145,15 @@ ibus_get_language_name(const gchar *_locale) {
-     }
-     return retval;
- }
-+
-+gboolean
-+ibus_use_bridge_hotkey (void)
-+{
-+    return (USE_BRIDGE_HOTKEY == 1) ? TRUE : FALSE;
-+}
-+
-+const gchar *
-+ibus_get_default_bridge_engine_name (void)
-+{
-+    return DEFAULT_BRIDGE_ENGINE_NAME;
-+}
-diff --git a/src/ibusutil.h b/src/ibusutil.h
-index 7cf1995..a19d16e 100644
---- a/src/ibusutil.h
-+++ b/src/ibusutil.h
-@@ -43,4 +43,18 @@
-  */
- const gchar *    ibus_get_language_name         (const gchar    *_locale);
- 
-+/**
-+ * ibus_bus_use_bridge_hotkey:
-+ * @bus: An #IBusBus.
-+ * @returns: %TRUE if @bus use bridge hotkey, %FALSE otherwise.
-+ */
-+gboolean         ibus_use_bridge_hotkey (void);
-+
-+/**
-+ * ibus_bus_get_default_bridge_engine_name:
-+ * @bus: An #IBusBus.
-+ * @returns: A default bridge engine name.
-+ */
-+const gchar *    ibus_get_default_bridge_engine_name (void);
-+
- #endif
-diff --git a/ui/gtk/panel.py b/ui/gtk/panel.py
-index 8804634..549393a 100644
---- a/ui/gtk/panel.py
-+++ b/ui/gtk/panel.py
-@@ -67,6 +67,7 @@ class Panel(ibus.PanelBase):
-         self.__data_dir = path.join(self.__prefix, "share", "ibus")
-         # self.__icons_dir = path.join(self.__data_dir, "icons")
-         self.__setup_cmd = path.join(self.__prefix, "bin", "ibus-setup")
-+        self.__show = 0
- 
-         # connect bus signal
-         self.__config.connect("value-changed", self.__config_value_changed_cb)
-@@ -133,6 +134,14 @@ class Panel(ibus.PanelBase):
-         # self.__bus.request_name(ibus.panel.IBUS_SERVICE_PANEL, 0)
- 
-         # init xkb
-+        self.__default_layout = 'default'
-+        self.__default_model = 'default'
-+        self.__default_option = 'default'
-+        self.__disabled_engines = []
-+        self.__disabled_engines_id = -1
-+        self.__disabled_engines_prev_id = -1
-+        self.__disabled_engines_swapped = 0
-+
-         self.__xkblayout = ibus.XKBLayout(self.__config)
-         use_xkb = self.__config.get_value("general", "use_system_keyboard_layout", False)
-         if not use_xkb:
-@@ -142,11 +151,18 @@ class Panel(ibus.PanelBase):
-             value = 'default'
-         if value != 'default':
-             self.__xkblayout.set_default_layout(value)
-+            if value.find('(') >= 0:
-+                [self.__default_layout, self.__default_model] = \
-+                    self.__xkblayout.get_default_layout()
-+            else:
-+                self.__default_layout = value
-+                self.__default_model = None
-         value = str(self.__config.get_value("general", "system_keyboard_option", ''))
-         if value == '':
-             value = 'default'
-         if value != 'default':
-             self.__xkblayout.set_default_option(value)
-+            self.__default_option = value
- 
-     def set_cursor_location(self, x, y, w, h):
-         self.__candidate_panel.set_cursor_location(x, y, w, h)
-@@ -233,12 +249,119 @@ class Panel(ibus.PanelBase):
-     def __set_im_name(self, name):
-         self.__language_bar.set_im_name(name)
- 
-+    def __use_bridge_hotkey(self):
-+        if not ibus.use_bridge_hotkey():
-+            return False
-+        if self.__config == None:
-+            return True
-+        return self.__config.get_value("general/hotkey", "use_bridge_hotkey",
-+                                       True)
-+
-+    def __registry_get_lang_from_layout(self, layout, model=None):
-+        langs = None
-+        lang = 'en'
-+        registry = ibus.XKBConfigRegistry()
-+        get_layout_lang = registry.get_layout_lang()
-+        if model == '':
-+            model = None
-+        if model != None:
-+            label = "%s(%s)" % (layout, model)
-+            if label in get_layout_lang:
-+                langs = get_layout_lang[label]
-+        if langs == None:
-+            label = layout
-+            if label in get_layout_lang:
-+                langs = get_layout_lang[label]
-+        if langs != None:
-+            lang = str(langs[0])
-+        return lang
-+
-+    def __set_default_layout_engine(self, use_bridge_hotkey):
-+        default_layout = self.__default_layout
-+        default_model = self.__default_model
-+        if default_layout == 'default':
-+            default_layout = self.__xkblayout.get_default_layout()[0]
-+            default_model = self.__xkblayout.get_default_layout()[1]
-+        if default_model == 'default':
-+            default_model = self.__xkblayout.get_default_layout()[1]
-+        layouts = default_layout.split(',')
-+        models = None
-+        if default_model != None and default_model != '':
-+            models = default_model.split(',')
-+        if len(self.__disabled_engines) == 0:
-+            for i, layout in enumerate(layouts):
-+                registry = ibus.XKBConfigRegistry()
-+                model = None
-+                if models != None and i < len(models):
-+                    model = models[i]
-+                lang = self.__registry_get_lang_from_layout(layout, model)
-+                model = None
-+                if i == 0:
-+                    layout = default_layout
-+                    model = default_model
-+                elif models != None and i < len(models):
-+                    model = models[i]
-+                if model == '':
-+                    model = None
-+                model_desc = _("Default Layout")
-+                if i == 0:
-+                    l = 0
-+                    # layout 'in' and model 'eng' is English layout.
-+                    if models != None and model != 'eng':
-+                        for j in range(0, len(models)):
-+                            l = l + len(models[j])
-+                    if l != 0:
-+                        model_desc = model_desc + " (" + model + ")"
-+                elif model != None:
-+                    model_desc = model_desc + " (" + model + ")"
-+                name = ibus.DEFAULT_BRIDGE_ENGINE_NAME + "#" + str(i)
-+                engine = registry.engine_desc_new(lang,
-+                                                  layout,
-+                                                  _("Default Layout"),
-+                                                  model,
-+                                                  model_desc,
-+                                                  name)
-+                self.__disabled_engines.append(engine)
-+            self.__disabled_engines_id = self.__xkblayout.get_group()
-+            if use_bridge_hotkey and len(self.__disabled_engines) > 0:
-+                self.__focus_ic.set_xkb_engines(self.__disabled_engines)
-+        if not use_bridge_hotkey:
-+            return
-+        if len(self.__disabled_engines) > 0:
-+            if self.__focus_ic == None:
-+                return
-+            engine = self.__focus_ic.get_engine()
-+            if engine == None:
-+                if self.__disabled_engines_id < 0:
-+                    self.__disabled_engines_id = 0
-+                self.__focus_ic.focus_in()
-+                self.__focus_ic.set_engine(self.__disabled_engines[self.__disabled_engines_id])
-+            elif engine != None and \
-+                 not self.__focus_ic.is_enabled():
-+                self.__focus_ic.focus_in()
-+                self.__focus_ic.enable()
-+
-     def focus_in(self, ic):
-         self.reset()
-         self.__focus_ic = ibus.InputContext(self.__bus, ic)
-         enabled = self.__focus_ic.is_enabled()
--        self.__language_bar.set_enabled(enabled)
- 
-+        use_bridge_hotkey = self.__use_bridge_hotkey()
-+        self.__set_default_layout_engine(use_bridge_hotkey)
-+        if use_bridge_hotkey:
-+            if self.__show != 1:
-+                self.__language_bar.set_enabled(enabled)
-+            elif enabled:
-+                engine = self.__focus_ic.get_engine()
-+                if engine != None and \
-+                   not engine.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
-+                    self.__language_bar.set_enabled(enabled)
-+                else:
-+                    self.__language_bar.set_enabled(False)
-+            else:
-+                self.__language_bar.set_enabled(False)
-+        else:
-+            self.__language_bar.set_enabled(enabled)
-         if not enabled:
-             self.__set_im_icon(ICON_KEYBOARD)
-             self.__set_im_name(None)
-@@ -247,10 +370,13 @@ class Panel(ibus.PanelBase):
-         else:
-             engine = self.__focus_ic.get_engine()
-             if engine:
--                self.__set_im_icon(engine.icon)
-+                if engine.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
-+                    self.__set_im_icon(ICON_KEYBOARD)
-+                else:
-+                    self.__set_im_icon(engine.icon)
-                 self.__set_im_name(engine.longname)
-                 if self.__bus.get_use_sys_layout():
--                    self.__xkblayout.set_layout(self.__engine_get_layout_wrapper(engine))
-+                    self.__xkblayout.set_layout(self.__engine_get_layout_wrapper(engine, False))
-             else:
-                 self.__set_im_icon(ICON_KEYBOARD)
-                 self.__set_im_name(None)
-@@ -273,7 +399,21 @@ class Panel(ibus.PanelBase):
-             return
- 
-         enabled = self.__focus_ic.is_enabled()
--        self.__language_bar.set_enabled(enabled)
-+
-+        if self.__use_bridge_hotkey():
-+            if self.__show != 1:
-+                self.__language_bar.set_enabled(enabled)
-+            elif enabled:
-+                engine = self.__focus_ic.get_engine()
-+                if engine != None and \
-+                   not engine.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
-+                    self.__language_bar.set_enabled(enabled)
-+                else:
-+                    self.__language_bar.set_enabled(False)
-+            else:
-+                self.__language_bar.set_enabled(False)
-+        else:
-+            self.__language_bar.set_enabled(enabled)
- 
-         if enabled == False:
-             self.reset()
-@@ -284,10 +424,13 @@ class Panel(ibus.PanelBase):
-         else:
-             engine = self.__focus_ic.get_engine()
-             if engine:
--                self.__set_im_icon(engine.icon)
-+                if engine.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
-+                    self.__set_im_icon(ICON_KEYBOARD)
-+                else:
-+                    self.__set_im_icon(engine.icon)
-                 self.__set_im_name(engine.longname)
-                 if self.__bus.get_use_sys_layout():
--                    self.__xkblayout.set_layout(self.__engine_get_layout_wrapper(engine))
-+                    self.__xkblayout.set_layout(self.__engine_get_layout_wrapper(engine, True))
-             else:
-                 self.__set_im_icon(ICON_KEYBOARD)
-                 self.__set_im_name(None)
-@@ -315,6 +458,7 @@ class Panel(ibus.PanelBase):
- 
-     def __config_load_show(self):
-         show = self.__config.get_value("panel", "show", 0)
-+        self.__show = show
-         self.__language_bar.set_show(show)
- 
-     def __config_load_position(self):
-@@ -443,6 +587,21 @@ class Panel(ibus.PanelBase):
-     #     menu.set_take_focus(False)
-     #     return menu
- 
-+    def __add_engine_in_menu(self, menu, engine, is_bold, size):
-+        language = engine.language
-+        lang = ibus.get_language_name(language)
-+        item = gtk.ImageMenuItem("%s - %s" % (lang, engine.longname))
-+        if is_bold:
-+            for widget in item.get_children():
-+                if isinstance(widget, gtk.Label):
-+                    widget.set_markup("<b>%s</b>" % widget.get_text())
-+        if engine.icon:
-+            item.set_image(_icon.IconWidget(engine.icon, size[0]))
-+        else:
-+            item.set_image(_icon.IconWidget(ICON_ENGINE, size[0]))
-+        item.connect("activate", self.__im_menu_item_activate_cb, engine)
-+        menu.add(item)
-+
-     def __create_im_menu(self):
-         engines = self.__bus.list_active_engines()
-         current_engine = \
-@@ -453,25 +612,39 @@ class Panel(ibus.PanelBase):
-         size = gtk.icon_size_lookup(gtk.ICON_SIZE_MENU)
-         menu = gtk.Menu()
-         for i, engine in enumerate(engines):
--            lang = ibus.get_language_name(engine.language)
--            item = gtk.ImageMenuItem("%s - %s" % (lang, engine.longname))
--            if current_engine and current_engine.name == engine.name:
--                for widget in item.get_children():
--                    if isinstance(widget, gtk.Label):
--                        widget.set_markup("<b>%s</b>" % widget.get_text())
--            if engine.icon:
--                item.set_image(_icon.IconWidget(engine.icon, size[0]))
--            else:
--                item.set_image(_icon.IconWidget(ICON_ENGINE, size[0]))
--            item.connect("activate", self.__im_menu_item_activate_cb, engine)
--            menu.add(item)
-+            if engine.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
-+                if not self.__use_bridge_hotkey():
-+                    continue
-+                if len(self.__disabled_engines) == 0:
-+                    continue
-+                engine.disabled_engines_id = -1
-+                for j, kb_engine in enumerate(self.__disabled_engines):
-+                    if engine.name == kb_engine.name:
-+                        engine.disabled_engines_id = j
-+                        break
-+                if engine.disabled_engines_id == -1:
-+                    continue
-+                kb_engine = self.__disabled_engines[engine.disabled_engines_id]
-+                kb_engine.is_bridge = True
-+                kb_engine.disabled_engines_id = engine.disabled_engines_id
-+                is_bold = True if (current_engine != None and \
-+                        current_engine.name == kb_engine.name) else False
-+                self.__add_engine_in_menu(menu, kb_engine,
-+                                          is_bold,
-+                                          size)
-+                continue
-+            engine.is_bridge = False
-+            is_bold = True if (current_engine != None and \
-+                    current_engine.name == engine.name) else False
-+            self.__add_engine_in_menu(menu, engine, is_bold, size)
- 
-         item = gtk.ImageMenuItem(_("Turn off input method"))
-         item.set_image(_icon.IconWidget("gtk-close", size[0]))
-         item.connect("activate", self.__im_menu_item_activate_cb, None)
-         if self.__focus_ic == None or not self.__focus_ic.is_enabled():
-             item.set_sensitive(False)
--        menu.add(item)
-+        if not self.__use_bridge_hotkey():
-+            menu.add(item)
- 
-         menu.show_all()
-         menu.set_take_focus(False)
-@@ -523,8 +696,25 @@ class Panel(ibus.PanelBase):
-         if not self.__focus_ic:
-             return
-         if engine:
--            self.__focus_ic.set_engine(engine)
-+            if self.__use_bridge_hotkey() and engine.is_bridge:
-+                engines = self.__bus.list_active_engines()
-+                current_engine = \
-+                    (self.__focus_ic != None and self.__focus_ic.get_engine()) or \
-+                    (engines and engines[0]) or \
-+                    None
-+                if current_engine and \
-+                   current_engine.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
-+                    self.__disabled_engines_prev_id = self.__disabled_engines_id
-+                    self.__disabled_engines_swapped = 2
-+                else:
-+                    self.__disabled_engines_prev_id = -1
-+                self.__disabled_engines_id = engine.disabled_engines_id
-+                self.__focus_ic.set_engine(self.__disabled_engines[self.__disabled_engines_id])
-+            else:
-+                self.__disabled_engines_prev_id = -1
-+                self.__focus_ic.set_engine(engine)
-         else:
-+            self.__disabled_engines_prev_id = -1
-             self.__focus_ic.disable()
- 
-     def __sys_menu_item_activate_cb(self, item, command):
-@@ -573,12 +763,113 @@ class Panel(ibus.PanelBase):
-         self.__setup_pid = pid
-         glib.child_watch_add(self.__setup_pid, self.__child_watch_cb)
- 
--    def __engine_get_layout_wrapper(self, engine):
-+    def __get_model_from_layout(self, layout):
-+        left_bracket = layout.find('(')
-+        right_bracket = layout.find(')')
-+        if left_bracket >= 0 and right_bracket > left_bracket:
-+            return (layout[:left_bracket] + layout[right_bracket + 1:], \
-+                    layout[left_bracket + 1:right_bracket])
-+        return (layout, "default")
-+
-+    def __get_option_from_layout(self, layout):
-+        left_bracket = layout.find('[')
-+        right_bracket = layout.find(']')
-+        if left_bracket >= 0 and right_bracket > left_bracket:
-+            return (layout[:left_bracket] + layout[right_bracket + 1:], \
-+                    layout[left_bracket + 1:right_bracket])
-+        return (layout, "default")
-+
-+    def __merge_models_and_options(self, cur_layout, engine_layout):
-+        orig_layout = cur_layout
-+        engine_model = "default"
-+        engine_option = "default"
-+        (engine_layout, engine_model) = \
-+            self.__get_model_from_layout(engine_layout)
-+        (engine_layout, engine_option) = \
-+            self.__get_option_from_layout(engine_layout)
-+        if (engine_model == None or engine_model == "default") and \
-+           (engine_option == None or engine_option == "default"):
-+            return cur_layout
-+        cur_model = "default"
-+        cur_option = "default"
-+        (cur_layout, cur_model) = \
-+            self.__get_model_from_layout(cur_layout)
-+        (cur_layout, cur_option) = \
-+            self.__get_option_from_layout(cur_layout)
-+        # Currently implemented options only.
-+        # Merging layouts and models are a little complicated.
-+        # e.g. ja,ru + ja(kana) == ja,ru,ja(,,kana)
-+        if engine_option != None and engine_option != "default":
-+            if cur_option == None or cur_option == "default":
-+                cur_option = engine_option
-+            elif cur_option != None and cur_option != "default":
-+                cur_option = "%s,%s" % (cur_option, engine_option)
-+            if cur_model != None and cur_model != "default":
-+                cur_layout = "%s(%s)" % (cur_layout, cur_model)
-+            if cur_option != None and cur_option != "default":
-+                cur_layout = "%s[%s]" % (cur_layout, cur_option)
-+            return cur_layout
-+        return orig_layout
-+
-+    def __engine_get_layout_wrapper(self, engine, changed_state):
-         # This code is for the back compatibility.
-         # Should we remove the codes after all IM engines are changed
-         # to "default" layout?
--        if engine.name != None and engine.name.startswith("xkb:layout:"):
-+        if engine.name != None and engine.name.startswith("xkb:layout:") and \
-+           not self.__use_bridge_hotkey():
-+            return engine.layout
-+        elif engine.name != None and \
-+             engine.name.startswith("xkb:layout:") and \
-+             self.__use_bridge_hotkey() and \
-+             not engine.name.startswith(ibus.DEFAULT_BRIDGE_ENGINE_NAME):
-             return engine.layout
-+        elif self.__use_bridge_hotkey() and \
-+           self.__disabled_engines_id >= 0 and \
-+           len(self.__disabled_engines) > 0 and \
-+           self.__disabled_engines_id < len(self.__disabled_engines):
-+            if changed_state and self.__disabled_engines_prev_id != -1:
-+                # stateChanged is always called triple because we change
-+                # the engine. So the first two calls are ignored here.
-+                # Since this._disabledEnginesPrevID needs to be reseted
-+                # to -1 and and stateChanged is called multiple times.
-+                # engine.layout is not used.
-+                #
-+                # When stateChanged is called by Control + Space,
-+                # this._disabledEnginesID and this._disabledEnginesPrevID
-+                # are toggled because this._disabledEnginesID is the
-+                # current XKB group id and this._disabledEnginesPrevID
-+                # is the next XKB group id.
-+                #
-+                # When stateChanged is called by ibus activate menu,
-+                # this._disabledEnginesID is the XKB group id.
-+                #
-+                # FIXME: If this._activeEngine is used, focusIn event is
-+                # called by either choosing ibus menu item or switching
-+                # input contexts.
-+                # So there is a bug: After XKB group is switched by
-+                # ibus menu, if the input contexts are switched, 
-+                # the next toggled input method has next XKB group keymap
-+                # instead of the current XKB group keymap.
-+                # focusIn event don't know either choosing ibus menu or
-+                # switching input contexts are happened.
-+                if self.__disabled_engines_swapped < 2:
-+                    x = self.__disabled_engines_prev_id
-+                    self.__disabled_engines_prev_id = self.__disabled_engines_id
-+                    self.__disabled_engines_id = x
-+                    self.__disabled_engines_swapped = \
-+                            1 if self.__disabled_engines_swapped == 0 else 0
-+                else:
-+                    self.__disabled_engines_swapped = \
-+                            self.__disabled_engines_swapped + 1 \
-+                            if self.__disabled_engines_swapped < 4 else 0
-+            retval = self.__disabled_engines[self.__disabled_engines_id].layout
-+            # engine is an input-method or a keymap and if engine is
-+            # a keymap, the layout is not 'default'.
-+            # if engine is an input-method, the layout is merged with the
-+            # current XKB keymap here.
-+            if engine.layout != None and engine.layout.startswith("default"):
-+                return self.__merge_models_and_options(retval, engine.layout)
-+            return retval
-         elif engine.layout != None and engine.layout.startswith("default"):
-             return engine.layout
-         else:
-diff --git a/xkb/Makefile.am b/xkb/Makefile.am
-index ad9cdd9..c4d5afb 100644
---- a/xkb/Makefile.am
-+++ b/xkb/Makefile.am
-@@ -28,6 +28,8 @@ INCLUDES = \
-         -I$(top_srcdir)/src \
- 	-DIBUS_LOCALEDIR=\"$(datadir)/locale\" \
- 	-DLIBEXECDIR=\""$(libexecdir)"\" \
-+	-DUSE_BRIDGE_HOTKEY=$(USE_BRIDGE_HOTKEY) \
-+	-DDEFAULT_BRIDGE_ENGINE_NAME=\"$(DEFAULT_BRIDGE_ENGINE_NAME)\" \
-         $(NULL)
- 
- noinst_PROGRAMS = $(TESTS)
-diff --git a/xkb/ibus-engine-xkb-main.c b/xkb/ibus-engine-xkb-main.c
-index 0fb0f0c..4787bf2 100644
---- a/xkb/ibus-engine-xkb-main.c
-+++ b/xkb/ibus-engine-xkb-main.c
-@@ -290,6 +290,9 @@ print_component ()
-     const gchar *desc;
-     gchar *output;
-     GString *str;
-+#if USE_BRIDGE_HOTKEY
-+    int i;
-+#endif
- 
- #ifdef XKBLAYOUTCONFIG_FILE
-     layout_config = ibus_xkb_layout_config_new (XKBLAYOUTCONFIG_FILE);
-@@ -302,6 +305,19 @@ print_component ()
-     layout_desc = (GHashTable *) ibus_xkb_config_registry_get_layout_desc (config_registry);
-     variant_desc = (GHashTable *) ibus_xkb_config_registry_get_variant_desc (config_registry);
-     component = ibus_xkb_component_new ();
-+#if USE_BRIDGE_HOTKEY
-+    for (i = 0; i < 4; i++) {
-+        gchar *name = g_strdup_printf ("%s#%d", DEFAULT_BRIDGE_ENGINE_NAME, i);
-+        engine = ibus_xkb_engine_desc_new ("eng",
-+                                           "us",
-+                                           _("Default Layout"),
-+                                           NULL,
-+                                           NULL,
-+                                           name);
-+        g_free (name);
-+        ibus_component_add_engine (component, engine);
-+    }
-+#endif
-     for (keys = g_hash_table_get_keys (layout_list); keys; keys = keys->next) {
-         if (keys->data == NULL) {
-             continue;
-diff --git a/xkb/xkbxml.c b/xkb/xkbxml.c
-index d59a929..86bcf8f 100644
---- a/xkb/xkbxml.c
-+++ b/xkb/xkbxml.c
-@@ -25,6 +25,7 @@
- #endif
- 
- #include <glib.h>
-+#include <string.h>
- 
- #include "xkbxml.h"
- #include "ibus.h"
-@@ -275,6 +276,7 @@ ibus_xkb_engine_desc_new (const gchar *l
-     gchar *desc = NULL;
-     gchar *engine_layout = NULL;
-     const gchar *name_prefix = "xkb:layout:";
-+    const gchar *icon = "ibus-engine";
- 
-     g_return_val_if_fail (lang != NULL && layout != NULL, NULL);
- 
-@@ -304,6 +306,12 @@ ibus_xkb_engine_desc_new (const gchar *l
-         desc = g_strdup_printf ("XKB %s keyboard layout", layout);
-         engine_layout = g_strdup (layout);
-     }
-+#if USE_BRIDGE_HOTKEY
-+    if (g_ascii_strncasecmp (name, DEFAULT_BRIDGE_ENGINE_NAME,
-+                             strlen (DEFAULT_BRIDGE_ENGINE_NAME)) == 0) {
-+        icon = "input-keyboard-symbolic";
-+    }
-+#endif
- 
-     engine = ibus_engine_desc_new (name,
-                                    longname,
-@@ -311,7 +319,7 @@ ibus_xkb_engine_desc_new (const gchar *l
-                                    lang,
-                                    "LGPL2.1",
-                                    "Takao Fujiwara <takao.fujiwara1@gmail.com>",
--                                   "ibus-engine",
-+                                   icon,
-                                    engine_layout);
- 
-     g_free (name);
--- 
-1.7.5.4
-

diff --git a/ibus-xx-f19-password.patch b/ibus-xx-f19-password.patch
deleted file mode 100644
index e4dd77b..0000000
--- a/ibus-xx-f19-password.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
-index eef062c..d644d69 100644
---- a/client/gtk2/ibusimcontext.c
-+++ b/client/gtk2/ibusimcontext.c
-@@ -845,6 +845,18 @@ ibus_im_context_focus_in (GtkIMContext *context)
-         return;
- 
-     /* don't set focus on password entry */
-+#if GTK_CHECK_VERSION (3, 6, 0)
-+    {
-+        GtkInputPurpose purpose;
-+
-+        g_object_get (G_OBJECT (context),
-+                      "input-purpose", &purpose,
-+                      NULL);
-+
-+        if (purpose == GTK_INPUT_PURPOSE_PASSWORD)
-+            return;
-+    }
-+#endif
-     if (ibusimcontext->client_window != NULL) {
-         GtkWidget *widget;
- 

diff --git a/ibus-xx-setup-frequent-lang.patch b/ibus-xx-setup-frequent-lang.patch
deleted file mode 100644
index 35600c9..0000000
--- a/ibus-xx-setup-frequent-lang.patch
+++ /dev/null
@@ -1,413 +0,0 @@
-From 79587f187998b6e89c478ac23c7dbcba56a91637 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 14 Jul 2014 16:21:19 +0900
-Subject: [PATCH] Enable ibus-setup to show the frequently used languages
- only in IME list.
-
----
- data/ibus.schemas.in    | 168 ++++++++++++++++++++++++++++++++++++++++++++++++
- setup/enginecombobox.py | 148 +++++++++++++++++++++++++++++++++++-------
- 2 files changed, 292 insertions(+), 24 deletions(-)
-
-diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in
-index 9ee0b1a..c638e7d 100644
---- a/data/ibus.schemas.in
-+++ b/data/ibus.schemas.in
-@@ -384,6 +384,174 @@ se,si,sk,sy,sy(ku),th,tj,tr,ua,uz,vn
-       </locale>
-     </schema>
-     <schema>
-+      <key>/schemas/desktop/ibus/general/xkblayoutconfig/group_list</key>
-+      <applyto>/desktop/ibus/general/xkblayoutconfig/group_list</applyto>
-+      <owner>ibus</owner>
-+      <type>list</type>
-+      <list_type>string</list_type>
-+      <default>[west_europe,south_europe,east_europe,north_europe,west_asia,center_asia,east_asia,india,australia]</default>
-+      <locale name="C">
-+        <short>List of system keyboard layout groups on ibus-setup</short>
-+           <long>The group list is used not to show all the system
-+                  keyboard layouts by default. The list item will be
-+                  appended at the end of gconf key. e.g.
-+                  .../xkblayoutconfig/item1</long>
-+      </locale>
-+    </schema>
-+    <schema>
-+      <key>/schemas/desktop/ibus/general/xkblayoutconfig/west_europe</key>
-+      <applyto>/desktop/ibus/general/xkblayoutconfig/west_europe</applyto>
-+      <owner>ibus</owner>
-+      <type>list</type>
-+      <list_type>string</list_type>
-+      <!--
-+      <default>[ad,be,br,de,ca,ch,cz,es,fr,gn,hu,ie,ie(CloGaelach),it,latam,nl,pt,si,sk]</default>
-+      -->
-+      <default>[ca,cs,de,en,es,fr,gd,hu,it,nl,pt,sk,sl]</default>
-+      <locale name="C">
-+        <short>List of European languages on ibus-setup</short>
-+           <long>ibus-setup shows the languages only in input method list
-+                  when you run ibus-setup on one of the languages.
-+                  Other languages are hidden under an extended button.</long>
-+      </locale>
-+    </schema>
-+    <schema>
-+      <key>/schemas/desktop/ibus/general/xkblayoutconfig/south_europe</key>
-+      <applyto>/desktop/ibus/general/xkblayoutconfig/south_europe</applyto>
-+      <owner>ibus</owner>
-+      <type>list</type>
-+      <list_type>string</list_type>
-+      <!--
-+      <default>[al,ba,bg,gr,me,mk,mt,ro,rs]</default>
-+      -->
-+      <default>[bg,bs,el,mk,mt,ro,sq,sr]</default>
-+      <locale name="C">
-+        <short>List of European languages on ibus-setup</short>
-+           <long>ibus-setup shows the languages only in input method list
-+                  when you run ibus-setup on one of the languages.
-+                  Other languages are hidden under an extended button.</long>
-+      </locale>
-+    </schema>
-+    <schema>
-+      <key>/schemas/desktop/ibus/general/xkblayoutconfig/east_europe</key>
-+      <applyto>/desktop/ibus/general/xkblayoutconfig/east_europe</applyto>
-+      <owner>ibus</owner>
-+      <type>list</type>
-+      <list_type>string</list_type>
-+      <!--
-+      <default>[by,ee,epo,ge,ge(dsb),ge(ru),ge(os),hr,kg,kz,lt,lv,pl,pl(csb),ru,ru(cv),ru(kom),ru(sah),ru(tt),ru(xal),ua,uz]</default>
-+      -->
-+      <default>[be,csb,cv,et,ka,kk,ky,lt,lv,pl,ru,tt,uk,uz]</default>
-+      <locale name="C">
-+        <short>List of European languages on ibus-setup</short>
-+           <long>ibus-setup shows the languages only in input method list
-+                  when you run ibus-setup on one of the languages.
-+                  Other languages are hidden under an extended button.</long>
-+      </locale>
-+    </schema>
-+    <schema>
-+      <key>/schemas/desktop/ibus/general/xkblayoutconfig/north_europe</key>
-+      <applyto>/desktop/ibus/general/xkblayoutconfig/north_europe</applyto>
-+      <owner>ibus</owner>
-+      <type>list</type>
-+      <list_type>string</list_type>
-+      <!--
-+      <default>[dk,fi,fo,is,no,no(smi),se]</default>
-+      -->
-+      <default>[da,fi,fo,is,no,se,sv]</default>
-+      <locale name="C">
-+        <short>List of European languages on ibus-setup</short>
-+           <long>ibus-setup shows the languages only in input method list
-+                  when you run ibus-setup on one of the languages.
-+                  Other languages are hidden under an extended button.</long>
-+      </locale>
-+    </schema>
-+    <schema>
-+      <key>/schemas/desktop/ibus/general/xkblayoutconfig/west_asia</key>
-+      <applyto>/desktop/ibus/general/xkblayoutconfig/west_asia</applyto>
-+      <owner>ibus</owner>
-+      <type>list</type>
-+      <list_type>string</list_type>
-+      <!--
-+      <default>[am,ara,az,et,gh,gh(akan),gh(ewe),gh(fula),gh(ga),gh(hausa),il,iq,iq(ku),ir,ir(ku),ma,ma(tifinagh),ng,ng(hausa),ng,ng(igbo),ng(yoruba),sy,sy(ku),tj,tr]</default>
-+      -->
-+      <default>[am,ar,az,ber,fa,ha,he,hy,ig,ku,tg,tr,yo]</default>
-+      <locale name="C">
-+        <short>List of Asian languages on ibus-setup</short>
-+           <long>ibus-setup shows the languages only in input method list
-+                  when you run ibus-setup on one of the languages.
-+                  Other languages are hidden under an extended button.</long>
-+      </locale>
-+    </schema>
-+    <schema>
-+      <key>/schemas/desktop/ibus/general/xkblayoutconfig/center_asia</key>
-+      <applyto>/desktop/ibus/general/xkblayoutconfig/center_asia</applyto>
-+      <owner>ibus</owner>
-+      <type>list</type>
-+      <list_type>string</list_type>
-+      <!--
-+      <default>[cn(tib)]</default>
-+      -->
-+      <default>[bo,zh]</default>
-+      <locale name="C">
-+        <short>List of Asian languages on ibus-setup</short>
-+           <long>ibus-setup shows the languages only in input method list
-+                  when you run ibus-setup on one of the languages.
-+                  Other languages are hidden under an extended button.</long>
-+      </locale>
-+    </schema>
-+    <schema>
-+      <key>/schemas/desktop/ibus/general/xkblayoutconfig/east_asia</key>
-+      <applyto>/desktop/ibus/general/xkblayoutconfig/east_asia</applyto>
-+      <owner>ibus</owner>
-+      <type>list</type>
-+      <list_type>string</list_type>
-+      <!--
-+      <default>[bt,kh,la,mal,mm,th,vn]</default>
-+      -->
-+      <default>[dz,km,lo,my,th,vi]</default>
-+      <locale name="C">
-+        <short>List of Asian languages on ibus-setup</short>
-+           <long>ibus-setup shows the languages only in input method list
-+                  when you run ibus-setup on one of the languages.
-+                  Other languages are hidden under an extended button.</long>
-+      </locale>
-+    </schema>
-+    <schema>
-+      <key>/schemas/desktop/ibus/general/xkblayoutconfig/india</key>
-+      <applyto>/desktop/ibus/general/xkblayoutconfig/india</applyto>
-+      <owner>ibus</owner>
-+      <type>list</type>
-+      <list_type>string</list_type>
-+      <!--
-+      <default>[bd,in,in(ben),in(guj),in(guru),in(jhelum),in(kan),in(mal),in(ori),in(tam),in(tel),in(urd-phonetic),in(bolnagri),lk,lk(tam_unicode),mv,np,pk]</default>
-+      -->
-+      <default>[bn,dv,gu,hi,kn,ml,ne,or,pa,si,ta,te,ur]</default>
-+      <locale name="C">
-+        <short>List of Asian languages on ibus-setup</short>
-+           <long>ibus-setup shows the languages only in input method list
-+                  when you run ibus-setup on one of the languages.
-+                  Other languages are hidden under an extended button.</long>
-+      </locale>
-+    </schema>
-+    <schema>
-+      <key>/schemas/desktop/ibus/general/xkblayoutconfig/australia</key>
-+      <applyto>/desktop/ibus/general/xkblayoutconfig/australia</applyto>
-+      <owner>ibus</owner>
-+      <type>list</type>
-+      <list_type>string</list_type>
-+      <!--
-+      <default>[mao]</default>
-+      -->
-+      <default>[mi]</default>
-+      <locale name="C">
-+        <short>List of Asian languages on ibus-setup</short>
-+           <long>ibus-setup shows the languages only in input method list
-+                  when you run ibus-setup on one of the languages.
-+                  Other languages are hidden under an extended button.</long>
-+      </locale>
-+    </schema>
-+    <schema>
-       <key>/schemas/desktop/ibus/panel/custom_font</key>
-       <applyto>/desktop/ibus/panel/custom_font</applyto>
-       <owner>ibus</owner>
-diff --git a/setup/enginecombobox.py b/setup/enginecombobox.py
-index 2a2a677..a203b25 100644
---- a/setup/enginecombobox.py
-+++ b/setup/enginecombobox.py
-@@ -24,6 +24,7 @@ import locale
- import functools
- import sys
- 
-+from gi.repository import Gio
- from gi.repository import GObject
- from gi.repository import Gtk
- from gi.repository import IBus
-@@ -47,6 +48,10 @@ class EngineComboBox(Gtk.ComboBox):
-         self.connect("notify::active", self.__notify_active_cb)
- 
-         self.__model = None
-+        self.__all_model = None
-+        self.__show_sub_lang = False
-+        self.__settings_xkblayoutconfig = Gio.Settings(
-+                schema = "org.freedesktop.ibus.general.xkblayoutconfig");
- 
-         renderer = Gtk.CellRendererPixbuf()
-         renderer.set_property("xalign", 0)
-@@ -60,20 +65,45 @@ class EngineComboBox(Gtk.ComboBox):
-         self.pack_start(renderer, True)
-         self.set_cell_data_func(renderer, self.__name_cell_data_cb, None)
- 
--    def set_engines(self, engines):
--        self.__model = Gtk.TreeStore(object)
-+    def __gconf_get_lang_list_from_locale(self):
-+        common_list = ['en', 'Other']
-+        loc = None
-+        try:
-+           loc = locale.setlocale (locale.LC_ALL)
-+        except:
-+            pass
-+        if loc == None:
-+            return common_list
-+        current_lang = IBus.get_language_name(loc)
-+        if current_lang == None:
-+            return common_list
-+        group_list = self.__settings_xkblayoutconfig.get_strv('group-list')
-+        if len(group_list) == 0:
-+            return [loc] + common_list
-+        lang_list = None
-+        for group in group_list:
-+            group = group.replace('_', '-')
-+            langs = self.__settings_xkblayoutconfig.get_strv(group)
-+            for lang in langs:
-+                if current_lang == IBus.get_language_name(lang):
-+                    lang_list = langs
-+                    break
-+            if lang_list != None:
-+                break
-+        if lang_list == None:
-+            return [loc] + common_list
-+        return lang_list + common_list
- 
--        iter1 = self.__model.append(None)
--        self.__model.set(iter1, 0, 0)
--        langs = {}
--        for e in engines:
--            l = IBus.get_language_name(e.get_language())
--            if l == None:
--                l = ""
--            if l not in langs:
--                langs[l] = []
--            langs[l].append(e)
-+    def __has_engine_in_lang_list(self, engine, lang_list):
-+        retval = False
-+        for lang in lang_list:
-+            if IBus.get_language_name(lang) == \
-+                IBus.get_language_name(engine.props.language):
-+                retval = True
-+                break
-+        return retval
- 
-+    def __model_append_langs(self, model, langs, visible):
-         keys = list(langs.keys())
-         keys.sort(key=functools.cmp_to_key(locale.strcoll))
-         loc = locale.getlocale()[0]
-@@ -91,22 +121,62 @@ class EngineComboBox(Gtk.ComboBox):
-             keys.remove(IBus.get_language_name("Other"))
-             keys += [IBus.get_language_name("Other")]
-         for l in keys:
--            iter1 = self.__model.append(None)
--            self.__model.set(iter1, 0, l)
-+            iter1 = model.append(None)
-+            model.set(iter1, 0, l)
-             def cmp_engine(a, b):
-                 if a.get_rank() == b.get_rank():
-                     return locale.strcoll(a.get_longname(), b.get_longname())
-                 return int(b.get_rank() - a.get_rank())
-             langs[l].sort(key=functools.cmp_to_key(cmp_engine))
-             for e in langs[l]:
--                iter2 = self.__model.append(iter1)
--                self.__model.set(iter2, 0, e)
-+                iter2 = model.append(iter1)
-+                model.set(iter2, 0, e)
-+
-+    def set_engines(self, engines):
-+        self.__model = Gtk.TreeStore(object)
- 
--        self.set_model(self.__model)
-+        iter1 = self.__model.append(None)
-+        self.__model.set(iter1, 0, 0)
-+        lang_list = self.__gconf_get_lang_list_from_locale()
-+        lang = {}
-+        sub_lang = {}
-+        for e in engines:
-+            l = IBus.get_language_name(e.props.language)
-+            if lang_list == None or \
-+                self.__has_engine_in_lang_list(e, lang_list):
-+                if l not in lang:
-+                    lang[l] = []
-+                lang[l].append(e)
-+            else:
-+                if l not in sub_lang:
-+                    sub_lang[l] = []
-+                sub_lang[l].append(e)
-+
-+        self.__model_append_langs(self.__model, lang, True)
-+        iter1 = self.__model.append(None)
-+        self.__model.set(iter1, 0, -1)
-+
-+        self.__all_model = Gtk.TreeStore(object)
-+        iter1 = self.__all_model.append(None)
-+        self.__all_model.set(iter1, 0, 0)
-+        self.__model_append_langs(self.__all_model, lang, False)
-+        iter1 = self.__all_model.append(None)
-+        self.__all_model.set(iter1, 0, -1)
-+        self.__model_append_langs(self.__all_model, sub_lang, False)
-+
-+        self.__toggle_sub_lang()
-+
-+    def __toggle_sub_lang(self):
-+        self.set_model(None)
-+        if self.__show_sub_lang:
-+            self.set_model(self.__all_model)
-+        else:
-+            self.set_model(self.__model)
-         self.set_active(0)
- 
-     def __icon_cell_data_cb(self, celllayout, renderer, model, iter, data):
--        engine = self.__model.get_value(iter, 0)
-+        model = self.get_model()
-+        engine = model.get_value(iter, 0)
- 
-         if isinstance(engine, str):
-             renderer.set_property("visible", False)
-@@ -115,8 +185,25 @@ class EngineComboBox(Gtk.ComboBox):
-             renderer.set_property("visible", False)
-             renderer.set_property("sensitive", False)
-         elif isinstance(engine, int):
--            renderer.set_property("visible", False)
--            renderer.set_property("sensitive", False)
-+            if engine == 0:
-+                renderer.set_property("visible", False)
-+                renderer.set_property("sensitive", False)
-+                renderer.set_property("pixbuf", None)
-+            elif engine < 0:
-+                if not self.__show_sub_lang:
-+                    pixbuf = load_icon("go-bottom", Gtk.IconSize.LARGE_TOOLBAR)
-+                else:
-+                    pixbuf = load_icon("go-up", Gtk.IconSize.LARGE_TOOLBAR)
-+                if pixbuf == None:
-+                    pixbuf = load_icon("image-missing",
-+                                       Gtk.IconSize.LARGE_TOOLBAR)
-+                if pixbuf == None:
-+                    renderer.set_property("visible", False)
-+                    renderer.set_property("sensitive", False)
-+                    return
-+                renderer.set_property("visible", True)
-+                renderer.set_property("sensitive", True)
-+                renderer.set_property("pixbuf", pixbuf)
-         else:
-             renderer.set_property("visible", True)
-             renderer.set_property("sensitive", True)
-@@ -124,7 +211,8 @@ class EngineComboBox(Gtk.ComboBox):
-             renderer.set_property("pixbuf", pixbuf)
- 
-     def __name_cell_data_cb(self, celllayout, renderer, model, iter, data):
--        engine = self.__model.get_value(iter, 0)
-+        model = self.get_model()
-+        engine = model.get_value(iter, 0)
- 
-         if isinstance (engine, str):
-             renderer.set_property("sensitive", False)
-@@ -136,8 +224,15 @@ class EngineComboBox(Gtk.ComboBox):
-             renderer.set_property("weight", Pango.Weight.NORMAL)
-         elif isinstance(engine, int):
-             renderer.set_property("sensitive", True)
--            renderer.set_property("text", _("Select an input method"))
--            renderer.set_property("weight", Pango.Weight.NORMAL)
-+            if engine == 0:
-+                renderer.set_property("text", _("Select an input method"))
-+                renderer.set_property("weight", Pango.Weight.NORMAL)
-+            elif engine < 0:
-+                if not self.__show_sub_lang:
-+                    renderer.set_property("text", _("Show all input methods"))
-+                else:
-+                    renderer.set_property("text", _("Show only input methods for your region"))
-+                renderer.set_property("weight", Pango.Weight.BOLD)
-         else:
-             renderer.set_property("sensitive", True)
-             renderer.set_property("text", engine.get_longname())
-@@ -153,7 +248,12 @@ class EngineComboBox(Gtk.ComboBox):
-             if i == 0 or i == -1:
-                 return None
-             iter = self.get_active_iter()
--            return self.get_model()[iter][0]
-+            model = self.get_model()
-+            if model[iter][0] == -1:
-+                self.__show_sub_lang = not self.__show_sub_lang
-+                self.__toggle_sub_lang()
-+                return None
-+            return model[iter][0]
-         else:
-             raise AttributeError('unknown property %s' % property.name)
- 
--- 
-1.8.5.3
-

diff --git a/ibus.spec b/ibus.spec
index 205b5f3..cb3e3e8 100644
--- a/ibus.spec
+++ b/ibus.spec
@@ -1,15 +1,8 @@
-%global with_preload_xkb_engine 1
 %global with_pygobject2 1
 %global with_pygobject3 1
 
 %global with_pkg_config %(pkg-config --version >/dev/null 2>&1 && echo -n "1" || echo -n "0")
 
-%if (0%{?fedora} > 19 || 0%{?rhel} > 7)
-%global with_wayland 1
-%else
-%global with_wayland 0
-%endif
-
 %if (0%{?fedora} > 20 || 0%{?rhel} > 7)
 %global with_python2_override_pkg 1
 %else
@@ -17,7 +10,6 @@
 %endif
 
 %global ibus_api_version 1.0
-%global ibus_xkb_version 1.5.0.20140114
 
 # for bytecompile in %%{_datadir}/ibus/setup
 %global __python %{__python3}
@@ -35,8 +27,8 @@
 %global dbus_python_version 0.83.0
 
 Name:           ibus
-Version:        1.5.7
-Release:        7%{?dist}
+Version:        1.5.8
+Release:        1%{?dist}
 Summary:        Intelligent Input Bus for Linux OS
 License:        LGPLv2+
 Group:          System Environment/Libraries
@@ -44,26 +36,8 @@ URL:            http://code.google.com/p/ibus/
 Source0:        https://github.com/ibus/ibus/releases/download/%{version}/%{name}-%{version}.tar.gz
 Source1:        %{name}-xinput
 Source2:        %{name}.conf.5
-# Actual path is https://github.com/.../%%{ibus_xkb_version}.tar.gz
-# Renamed %%{ibus_xkb_version}.tar.gz to ibus-xkb-%%{ibus_xkb_version}.tar.gz
-Source3:        https://github.com/ibus/ibus-xkb/archive/ibus-xkb-%{ibus_xkb_version}.tar.gz
 # Upstreamed patches.
 # Patch0:         %%{name}-HEAD.patch
-Patch0:         %{name}-HEAD.patch
-# https://bugzilla.redhat.com/show_bug.cgi?id=810211
-Patch1:         %{name}-810211-no-switch-by-no-trigger.patch
-# https://bugzilla.redhat.com/show_bug.cgi?id=541492
-Patch2:         %{name}-541492-xkb.patch
-# https://bugzilla.redhat.com/show_bug.cgi?id=530711
-Patch3:         %{name}-530711-preload-sys.patch
-# Hide minor input method engines on ibus-setup by locale
-Patch4:         %{name}-xx-setup-frequent-lang.patch
-
-# Removed the target.
-# Even if fedpkg srpm's target is rhel, it can run on fedora box.
-# Disable IME on gnome-shell password for the back compatiblity.
-Patch96:        %{name}-xx-f19-password.patch
-
 
 BuildRequires:  gettext-devel
 BuildRequires:  libtool
@@ -86,17 +60,13 @@ BuildRequires:  GConf2-devel
 BuildRequires:  intltool
 BuildRequires:  iso-codes-devel
 BuildRequires:  libnotify-devel
-%if %with_wayland
 BuildRequires:  libwayland-client-devel
-%endif
 
 Requires:       %{name}-libs%{?_isa}   = %{version}-%{release}
 Requires:       %{name}-gtk2%{?_isa}   = %{version}-%{release}
 Requires:       %{name}-gtk3%{?_isa}   = %{version}-%{release}
 Requires:       %{name}-setup          = %{version}-%{release}
-%if %with_wayland
 Requires:       %{name}-wayland%{?_isa} = %{version}-%{release}
-%endif
 
 Requires:       iso-codes
 Requires:       dbus-python >= %{dbus_python_version}
@@ -113,8 +83,6 @@ Requires:       python3-gobject
 Requires:       xorg-x11-xinit
 # for setxkbmap
 Requires:       xorg-x11-xkb-utils
-# The feature in ibus-gnome3 is provided by gnome-shell.
-Obsoletes:      ibus-gnome3 < %{version}-%{release}
 
 Requires(post):  desktop-file-utils
 Requires(postun):  desktop-file-utils
@@ -142,7 +110,7 @@ Requires:       gobject-introspection
 This package contains the libraries for IBus
 
 %package gtk2
-Summary:        IBus im module for gtk2
+Summary:        IBus IM module for GTK2
 Group:          System Environment/Libraries
 Requires:       %{name}%{?_isa}        = %{version}-%{release}
 Requires:       %{name}-libs%{?_isa}   = %{version}-%{release}
@@ -152,17 +120,17 @@ Provides:       ibus-gtk = %{version}-%{release}
 Obsoletes:      ibus-gtk < %{version}-%{release}
 
 %description gtk2
-This package contains ibus im module for gtk2
+This package contains IBus IM module for GTK2
 
 %package gtk3
-Summary:        IBus im module for gtk3
+Summary:        IBus IM module for GTK3
 Group:          System Environment/Libraries
 Requires:       %{name}%{?_isa}        = %{version}-%{release}
 Requires:       %{name}-libs%{?_isa}   = %{version}-%{release}
 Requires(post): glib2 >= %{glib_ver}
 
 %description gtk3
-This package contains ibus im module for gtk3
+This package contains IBus IM module for GTK3
 
 %if %with_pygobject3
 %package setup
@@ -181,40 +149,38 @@ This is a setup utility for IBus.
 
 %if %with_pygobject2
 %package pygtk2
-Summary:        IBus pygtk2 library
+Summary:        IBus PyGTK2 library
 Group:          System Environment/Libraries
 Requires:       %{name} = %{version}-%{release}
 Requires:       pygtk2
 BuildArch:      noarch
 
 %description pygtk2
-This is a pygtk2 library for IBus. Now major IBus engines use pygobject3
+This is a PyGTK2 library for IBus. Now major IBus engines use PyGObject3
 and this package will be deprecated.
 %endif
 
 %if %with_python2_override_pkg
 %package py2override
-Summary:        IBus python2 override library
+Summary:        IBus Python2 override library
 Group:          System Environment/Libraries
 Requires:       %{name}-libs%{?_isa}   = %{version}-%{release}
 # Owner of %%python2_sitearch/gi/overrides
 Requires:       pygobject3-base
 
 %description py2override
-This is a python2 override library for IBus. The python files override
-some functions in gobject-introspection.
+This is a Python2 override library for IBus. The Python files override
+some functions in GObject-Introspection.
 %endif
 
-%if %with_wayland
 %package wayland
-Summary:        IBus im module for Wayland
+Summary:        IBus IM module for Wayland
 Group:          System Environment/Libraries
 Requires:       %{name}%{?_isa}        = %{version}-%{release}
 Requires:       %{name}-libs%{?_isa}   = %{version}-%{release}
 
 %description wayland
-This package contains IBus im module for Wayland
-%endif
+This package contains IBus IM module for Wayland
 
 %package devel
 Summary:        Development tools for ibus
@@ -233,7 +199,7 @@ The ibus-devel package contains the header files and developer
 docs for ibus.
 
 %package devel-docs
-Summary:        Developer documents for ibus
+Summary:        Developer documents for IBus
 Group:          Development/Libraries
 %if (0%{?fedora} >= 19 || 0%{?rhel} >= 7)
 Requires:       %{name}                = %{version}-%{release}
@@ -243,39 +209,17 @@ Requires:       %{name}%{?_isa}        = %{version}-%{release}
 %endif
 
 %description devel-docs
-The ibus-devel-docs package contains developer documentation for ibus
+The ibus-devel-docs package contains developer documentation for IBus
 
 
 %prep
 %setup -q
 # %%patch0 -p1
-%patch0 -p1
-%if (0%{?fedora} < 20 && 0%{?rhel} < 8)
-%patch96 -p1 -b .passwd
-%endif
-cp client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c ||
-
-%patch1 -p1 -b .noswitch
-%if %with_preload_xkb_engine
-%patch2 -p1 -b .preload-xkb
-rm -f bindings/vala/ibus-1.0.vapi
-rm -f data/dconf/00-upstream-settings
-%endif
-%patch3 -p1 -b .preload-sys
-%patch4 -p1 -b .setup-frequent-lang
-
-zcat %SOURCE3 | tar xf -
-POS=`(cd ibus-xkb-%ibus_xkb_version/po; ls *.po)`
-for PO in $POS
-do
-  cp po/$PO po/$PO.orig
-  msgcat --use-first po/$PO ibus-xkb-%ibus_xkb_version/po/$PO -o po/$PO
-done
+# cp client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c ||
 
 %build
-%if %with_preload_xkb_engine
-autoreconf -f -i -v
-%endif
+#autoreconf -f -i -v
+#make -C ui/gtk3 maintainer-clean-generic
 %configure \
     --disable-static \
     --enable-gtk2 \
@@ -288,15 +232,9 @@ autoreconf -f -i -v
 %if %with_pygobject2
     --enable-python-library \
 %endif
-%if %with_wayland
     --enable-wayland \
-%endif
     --enable-introspection
 
-%if %with_preload_xkb_engine
-make -C ui/gtk3 maintainer-clean-generic
-%endif
-# make -C po update-gmo
 make %{?_smp_mflags}
 
 %install
@@ -446,10 +384,8 @@ fi
 %python2_sitearch/gi/overrides/IBus.py*
 %endif
 
-%if %with_wayland
 %files wayland
 %{_libexecdir}/ibus-wayland
-%endif
 
 %files devel
 %{_libdir}/lib*.so
@@ -466,6 +402,14 @@ fi
 %{_datadir}/gtk-doc/html/*
 
 %changelog
+* Thu Jul 24 2014 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.8-1
+- Bumped to 1.5.8
+- Deleted ibus-810211-no-switch-by-no-trigger.patch
+- Deleted ibus-541492-xkb.patch
+- Deleted ibus-530711-preload-sys.patch
+- Deleted ibus-xx-setup-frequent-lang.patch
+- Deleted ibus-xx-f19-password.patch
+
 * Tue Jul 22 2014 Kalev Lember <kalevlember@gmail.com> - 1.5.7-7
 - Rebuilt for gobject-introspection 1.41.4
 

diff --git a/sources b/sources
index 1b21be7..e3856f7 100644
--- a/sources
+++ b/sources
@@ -1,2 +1 @@
-87f2269ef9523733a5693f0ed410ea71  ibus-1.5.7.tar.gz
-c0bc5be7f0c068bea1e4785c5b60694b  ibus-xkb-1.5.0.20140114.tar.gz
+b9fcfa20bd7b555bb4b438f719c0f2fb  ibus-1.5.8.tar.gz

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-31  2:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-31  2:06 [rpms/ibus] autotool: Bumped to 1.5.8 Takao Fujiwara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox