You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
3.2 KiB
86 lines
3.2 KiB
11 years ago
|
diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in
|
||
|
index dbb6da8..54ccb4c 100644
|
||
|
--- a/data/ibus.schemas.in
|
||
|
+++ b/data/ibus.schemas.in
|
||
|
@@ -224,7 +224,7 @@
|
||
|
<applyto>/desktop/ibus/general/use_system_keyboard_layout</applyto>
|
||
|
<owner>ibus</owner>
|
||
|
<type>bool</type>
|
||
|
- <default>true</default>
|
||
|
+ <default>false</default>
|
||
|
<locale name="C">
|
||
|
<short>Use system keyboard layout</short>
|
||
|
<long>Use system keyboard (XKB) layout</long>
|
||
|
diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
|
||
|
index 24e6b2e..18ef5c0 100644
|
||
|
--- a/ui/gtk3/panel.vala
|
||
|
+++ b/ui/gtk3/panel.vala
|
||
|
@@ -48,6 +48,7 @@ class Panel : IBus.PanelService {
|
||
|
private Gtk.AboutDialog m_about_dialog;
|
||
|
private Gtk.CssProvider m_css_provider;
|
||
|
private int m_switcher_delay_time = 400;
|
||
|
+ private bool m_use_system_keyboard_layout = false;
|
||
|
private const string ACCELERATOR_SWITCH_IME_FOREWARD = "<Control>space";
|
||
|
|
||
|
private GLib.List<Keybinding> m_keybindings = new GLib.List<Keybinding>();
|
||
|
@@ -265,6 +266,22 @@ class Panel : IBus.PanelService {
|
||
|
}
|
||
|
}
|
||
|
|
||
|
+ private void set_use_system_keyboard_layout(Variant? variant) {
|
||
|
+ Variant var_use_system_kbd_layout = variant;
|
||
|
+
|
||
|
+ if (var_use_system_kbd_layout == null) {
|
||
|
+ var_use_system_kbd_layout = m_config.get_value(
|
||
|
+ "general",
|
||
|
+ "use_system_keyboard_layout");
|
||
|
+ }
|
||
|
+
|
||
|
+ if (var_use_system_kbd_layout == null) {
|
||
|
+ return;
|
||
|
+ }
|
||
|
+
|
||
|
+ m_use_system_keyboard_layout = var_use_system_kbd_layout.get_boolean();
|
||
|
+ }
|
||
|
+
|
||
|
public void set_config(IBus.Config config) {
|
||
|
if (m_config != null) {
|
||
|
m_config.value_changed.disconnect(config_value_changed_cb);
|
||
|
@@ -278,9 +295,13 @@ class Panel : IBus.PanelService {
|
||
|
m_config.watch("general", "preload_engines");
|
||
|
m_config.watch("general", "engines_order");
|
||
|
m_config.watch("general", "switcher_delay_time");
|
||
|
+ m_config.watch("general", "use_system_keyboard_layout");
|
||
|
m_config.watch("general/hotkey", "triggers");
|
||
|
m_config.watch("panel", "custom_font");
|
||
|
m_config.watch("panel", "use_custom_font");
|
||
|
+ // Update m_use_system_keyboard_layout before update_engines()
|
||
|
+ // is called.
|
||
|
+ set_use_system_keyboard_layout(null);
|
||
|
update_engines(m_config.get_value("general", "preload_engines"),
|
||
|
m_config.get_value("general", "engines_order"));
|
||
|
unbind_switch_shortcut();
|
||
|
@@ -352,7 +373,9 @@ class Panel : IBus.PanelService {
|
||
|
return;
|
||
|
}
|
||
|
// set xkb layout
|
||
|
- exec_setxkbmap(engine);
|
||
|
+ if (!m_use_system_keyboard_layout) {
|
||
|
+ exec_setxkbmap(engine);
|
||
|
+ }
|
||
|
}
|
||
|
|
||
|
private void config_value_changed_cb(IBus.Config config,
|
||
|
@@ -380,6 +403,11 @@ class Panel : IBus.PanelService {
|
||
|
set_switcher_delay_time(variant);
|
||
|
return;
|
||
|
}
|
||
|
+
|
||
|
+ if (section == "general" && name == "use_system_keyboard_layout") {
|
||
|
+ set_use_system_keyboard_layout(variant);
|
||
|
+ return;
|
||
|
+ }
|
||
|
}
|
||
|
|
||
|
private void handle_engine_switch(Gdk.Event event, bool revert) {
|