From 469335730bb9dc7ba1702cfc5108491b6993677b Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Wed, 9 May 2012 17:09:23 +0900
Subject: [PATCH] Fix not to switch engines by non-trigger keys.

---
 ui/gtk3/switcher.vala |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ui/gtk3/switcher.vala b/ui/gtk3/switcher.vala
index 73b58d2..81812ec 100644
--- a/ui/gtk3/switcher.vala
+++ b/ui/gtk3/switcher.vala
@@ -58,6 +58,7 @@ class Switcher : Gtk.Window {
                 event.key.state & KeybindingManager.MODIFIER_FILTER);
 
         update_engines(engines);
+        m_result = 0;
         m_selected_engine = index;
         m_buttons[index].grab_focus();
 
@@ -242,7 +243,11 @@ class Switcher : Gtk.Window {
                 break;
             default:
                 debug("0x%04x", pe->keyval);
-                break;
+                if (m_loop != null) {
+                    m_loop.quit();
+                    m_loop = null;
+                }
+                return false;
         }
         return true;
     }
-- 
1.7.10

From 32533c72be144e0a26902e11ed0b967208a17317 Mon Sep 17 00:00:00 2001
From: Peng Huang <shawn.p.huang@gmail.com>
Date: Thu, 17 May 2012 11:08:14 -0400
Subject: [PATCH] Don't not set orientation when hide lookup table to improve
 UI performance.

BUG=http://code.google.com/p/ibus/issues/detail?id=1461
TEST=manually

Review URL: https://codereview.appspot.com/6203085
---
 ui/gtk3/candidatepanel.vala |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/ui/gtk3/candidatepanel.vala b/ui/gtk3/candidatepanel.vala
index a029e8f..0cf3c57 100644
--- a/ui/gtk3/candidatepanel.vala
+++ b/ui/gtk3/candidatepanel.vala
@@ -155,9 +155,15 @@ public class CandidatePanel : Gtk.HBox{
 
             orientation = (IBus.Orientation)table.get_orientation();
         }
+
         m_candidate_area.set_candidates(candidates, cursor_in_page, show_cursor);
         set_labels(labels);
-        set_orientation(orientation);
+
+        if (table != null) {
+            // Do not change orientation if table is null to avoid recreate
+            // candidates area.
+            set_orientation(orientation);
+        }
 
         if (candidates.length != 0)
             m_candidate_area.show_all();
-- 
1.7.10

From 4bee2863e8d2e51b185b6d149e6259848d8c0cb6 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno@unixuser.org>
Date: Sun, 20 May 2012 15:01:01 +0900
Subject: [PATCH] dconf: use text-based key file and dconf update

BUG=none
TEST=manually

Review URL: https://codereview.appspot.com/6215062
---
 data/dconf/Makefile.am               |   18 +++++++++++-------
 data/dconf/make-dconf-override-db.sh |   33 ++++++++++++++++++++++++---------
 2 files changed, 35 insertions(+), 16 deletions(-)

diff --git a/data/dconf/Makefile.am b/data/dconf/Makefile.am
index daea896..54861a7 100644
--- a/data/dconf/Makefile.am
+++ b/data/dconf/Makefile.am
@@ -32,6 +32,7 @@ EXTRA_DIST = \
 	$(gsettings_schemas_in_files) \
 	make-dconf-override-db.sh \
 	profile/ibus \
+	00-upstream-settings \
 	$(NULL)
 
 DISTCLEANFILES = \
@@ -40,23 +41,26 @@ DISTCLEANFILES = \
 
 MAINTAINERCLEANFILES = \
 	$(gsettings_schemas_in_files) \
+	00-upstream-settings \
 	$(NULL)
 
-CLEANFILES = \
-	db/ibus \
-	$(NULL)
+dconfprofiledir = $(sysconfdir)/dconf/profile
+dconfprofile_DATA = profile/ibus
 
-dconfprofiledir = $(sysconfdir)/dconf
-nobase_dconfprofile_DATA = db/ibus profile/ibus
+dconfdbdir = $(sysconfdir)/dconf/db/ibus.d
+dconfdb_DATA = 00-upstream-settings
 
 org.freedesktop.ibus.gschema.xml.in: $(top_srcdir)/data/ibus.schemas.in
 	$(AM_V_GEN) gsettings-schema-convert --force --gconf --xml \
 		--schema-id "org.freedesktop.ibus" \
 		--output $@ $<
 
-db/ibus: $(srcdir)/make-dconf-override-db.sh $(gsettings_SCHEMAS)
+00-upstream-settings: $(srcdir)/make-dconf-override-db.sh $(gsettings_SCHEMAS)
 	@$(MKDIR_P) db
-	$(AM_V_GEN) $(srcdir)/make-dconf-override-db.sh $@ || \
+	$(AM_V_GEN) $(srcdir)/make-dconf-override-db.sh > $@ || \
 		{ rc=$$?; $(RM) -rf $@; exit $$rc; }
 
+install-data-hook:
+	dconf update
+
 -include $(top_srcdir)/git.mk
diff --git a/data/dconf/make-dconf-override-db.sh b/data/dconf/make-dconf-override-db.sh
index 0d8456b..49a6df9 100755
--- a/data/dconf/make-dconf-override-db.sh
+++ b/data/dconf/make-dconf-override-db.sh
@@ -15,17 +15,32 @@ trap 'rm -rf $TMPDIR; kill $DBUS_SESSION_BUS_PID' ERR
 # in case that schema is not installed on the system
 glib-compile-schemas --targetdir "$GSETTINGS_SCHEMA_DIR" "$PWD"
 
-gsettings list-recursively org.freedesktop.ibus.general | \
-while read schema key val; do
-    gsettings set "$schema" "$key" "$val"
+cat <<EOF
+# This file is a part of the IBus packaging and should not be changed.
+#
+# Instead create your own file next to it with a higher numbered prefix,
+# and run
+#
+#       dconf update
+#
+EOF
+
+# Loop over top level schemas since "gsettings list-recursively" only
+# looks for direct children.
+schemas="org.freedesktop.ibus.general org.freedesktop.ibus.panel"
+current_schema=
+for schema in $schemas; do
+  gsettings list-recursively $schema | \
+  while read schema key val; do
+    if test "$schema" != "$current_schema"; then
+      echo
+      echo $schema | sed 's/org\.freedesktop\(.*\)/[desktop\1]/' | tr '.' '/'
+      current_schema="$schema"
+    fi
+    echo "$key=$val"
+  done
 done
 
-gsettings list-recursively org.freedesktop.ibus.panel | \
-while read schema key val; do
-    gsettings set "$schema" "$key" "$val"
-done
-
-mv $XDG_CONFIG_HOME/dconf/user "$1"
 rm -rf $TMPDIR
 
 kill $DBUS_SESSION_BUS_PID
-- 
1.7.10

