diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/main.vala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/main.vala b/lib/main.vala index 11802d8a..a0315590 100644 --- a/lib/main.vala +++ b/lib/main.vala @@ -41,6 +41,8 @@ public class Indicator.Keyboard.Service : Object { private MenuModel? menu_model; private Menu? sources_menu; + private uint lightdm_current; + [DBus (visible = false)] public Service (ref unowned string[] args) { force = "--force" in args; @@ -112,6 +114,8 @@ public class Indicator.Keyboard.Service : Object { [DBus (visible = false)] private void migrate_keyboard_layouts () { if (is_login_user ()) { + lightdm_current = source_settings.get_uint ("current"); + var manager = Act.UserManager.get_default (); if (manager.is_loaded) { @@ -298,6 +302,12 @@ public class Indicator.Keyboard.Service : Object { builder.add ("(ss)", "xkb", name); } + if (lightdm_current < list.size) { + source_settings.set_uint ("current", lightdm_current); + } else { + source_settings.set_uint ("current", list.size - 1); + } + source_settings.set_value ("sources", builder.end ()); } |