Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 460796 | Differences between
and this patch

Collapse All | Expand All

(-)a/files/ibus-1.5.1-use-system-keyboard-layout.patch (+85 lines)
Line 0 Link Here
1
diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in
2
index dbb6da8..54ccb4c 100644
3
--- a/data/ibus.schemas.in
4
+++ b/data/ibus.schemas.in
5
@@ -224,7 +224,7 @@
6
       <applyto>/desktop/ibus/general/use_system_keyboard_layout</applyto>
7
       <owner>ibus</owner>
8
       <type>bool</type>
9
-      <default>true</default>
10
+      <default>false</default>
11
       <locale name="C">
12
         <short>Use system keyboard layout</short>
13
 	    <long>Use system keyboard (XKB) layout</long>
14
diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
15
index 24e6b2e..18ef5c0 100644
16
--- a/ui/gtk3/panel.vala
17
+++ b/ui/gtk3/panel.vala
18
@@ -48,6 +48,7 @@ class Panel : IBus.PanelService {
19
     private Gtk.AboutDialog m_about_dialog;
20
     private Gtk.CssProvider m_css_provider;
21
     private int m_switcher_delay_time = 400;
22
+    private bool m_use_system_keyboard_layout = false;
23
     private const string ACCELERATOR_SWITCH_IME_FOREWARD = "<Control>space";
24
 
25
     private GLib.List<Keybinding> m_keybindings = new GLib.List<Keybinding>();
26
@@ -265,6 +266,22 @@ class Panel : IBus.PanelService {
27
         }
28
     }
29
 
30
+    private void set_use_system_keyboard_layout(Variant? variant) {
31
+        Variant var_use_system_kbd_layout = variant;
32
+
33
+        if (var_use_system_kbd_layout == null) {
34
+            var_use_system_kbd_layout = m_config.get_value(
35
+                    "general",
36
+                    "use_system_keyboard_layout");
37
+        }
38
+
39
+        if (var_use_system_kbd_layout == null) {
40
+            return;
41
+        }
42
+
43
+        m_use_system_keyboard_layout = var_use_system_kbd_layout.get_boolean();
44
+    }
45
+
46
     public void set_config(IBus.Config config) {
47
         if (m_config != null) {
48
             m_config.value_changed.disconnect(config_value_changed_cb);
49
@@ -278,9 +295,13 @@ class Panel : IBus.PanelService {
50
             m_config.watch("general", "preload_engines");
51
             m_config.watch("general", "engines_order");
52
             m_config.watch("general", "switcher_delay_time");
53
+            m_config.watch("general", "use_system_keyboard_layout");
54
             m_config.watch("general/hotkey", "triggers");
55
             m_config.watch("panel", "custom_font");
56
             m_config.watch("panel", "use_custom_font");
57
+            // Update m_use_system_keyboard_layout before update_engines()
58
+            // is called.
59
+            set_use_system_keyboard_layout(null);
60
             update_engines(m_config.get_value("general", "preload_engines"),
61
                            m_config.get_value("general", "engines_order"));
62
             unbind_switch_shortcut();
63
@@ -352,7 +373,9 @@ class Panel : IBus.PanelService {
64
             return;
65
         }
66
         // set xkb layout
67
-        exec_setxkbmap(engine);
68
+        if (!m_use_system_keyboard_layout) {
69
+            exec_setxkbmap(engine);
70
+        }
71
     }
72
 
73
     private void config_value_changed_cb(IBus.Config config,
74
@@ -380,6 +403,11 @@ class Panel : IBus.PanelService {
75
             set_switcher_delay_time(variant);
76
             return;
77
         }
78
+
79
+        if (section == "general" && name == "use_system_keyboard_layout") {
80
+            set_use_system_keyboard_layout(variant);
81
+            return;
82
+        }
83
     }
84
 
85
     private void handle_engine_switch(Gdk.Event event, bool revert) {
(-)a/ibus-1.5.1-r1.ebuild (-5 / +6 lines)
Lines 18-24 Link Here
18
LICENSE="LGPL-2.1"
18
LICENSE="LGPL-2.1"
19
SLOT="0"
19
SLOT="0"
20
KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
20
KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
21
IUSE="dconf deprecated +gconf gtk +gtk3 +introspection nls +python test vala +X"
21
IUSE="dconf deprecated +gconf gtk +gtk3 +introspection nls +python test +X"
22
REQUIRED_USE="|| ( gtk gtk3 X )
22
REQUIRED_USE="|| ( gtk gtk3 X )
23
	deprecated? ( python )
23
	deprecated? ( python )
24
	python? ( || ( deprecated ( gtk3 introspection ) ) )" #342903
24
	python? ( || ( deprecated ( gtk3 introspection ) ) )" #342903
Lines 56-62 Link Here
56
	dev-util/intltool
56
	dev-util/intltool
57
	virtual/pkgconfig
57
	virtual/pkgconfig
58
	nls? ( >=sys-devel/gettext-0.16.1 )
58
	nls? ( >=sys-devel/gettext-0.16.1 )
59
	vala? ( $(vala_depend) )"
59
	$(vala_depend)"
60
60
61
# stress test in bus/ fails
61
# stress test in bus/ fails
62
# IBUS-CRITICAL **: bus_test_client_init: assertion `ibus_bus_is_connected (_bus)' failed
62
# IBUS-CRITICAL **: bus_test_client_init: assertion `ibus_bus_is_connected (_bus)' failed
Lines 76-84 Link Here
76
	sed -e 's/dconf update/$(NULL)/' \
76
	sed -e 's/dconf update/$(NULL)/' \
77
		-i data/dconf/Makefile.{am,in} || die
77
		-i data/dconf/Makefile.{am,in} || die
78
	use python && python_clean_py-compile_files
78
	use python && python_clean_py-compile_files
79
	use vala && vala_src_prepare
79
	vala_src_prepare
80
	epatch "${FILESDIR}"/${P}-setup.patch \
80
	epatch "${FILESDIR}"/${P}-setup.patch \
81
		"${FILESDIR}"/${P}-queue-events.patch
81
		"${FILESDIR}"/${P}-queue-events.patch \
82
		"${FILESDIR}"/${P}-use-system-keyboard-layout.patch
82
	cp "${S}"/client/gtk2/ibusimcontext.c "${S}"/client/gtk3/ibusimcontext.c || die
83
	cp "${S}"/client/gtk2/ibusimcontext.c "${S}"/client/gtk3/ibusimcontext.c || die
83
}
84
}
84
85
Lines 102-109 Link Here
102
		$(use_enable gtk3 ui) \
103
		$(use_enable gtk3 ui) \
103
		$(use_enable nls) \
104
		$(use_enable nls) \
104
		$(use_enable test tests) \
105
		$(use_enable test tests) \
105
		$(use_enable vala) \
106
		$(use_enable X xim) \
106
		$(use_enable X xim) \
107
		--enable-vala \
107
		${python_conf}
108
		${python_conf}
108
}
109
}
109
110

Return to bug 460796