From caa8187d0c9dd3e891b9a0ba4967fdeb901f76e9 Mon Sep 17 00:00:00 2001 From: William Hua Date: Sat, 21 Sep 2013 11:01:35 -0400 Subject: Always add the default layout. --- lib/main.vala | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/main.vala b/lib/main.vala index 026be597..11802d8a 100644 --- a/lib/main.vala +++ b/lib/main.vala @@ -281,20 +281,21 @@ public class Indicator.Keyboard.Service : Object { } } - if (list.size == 0) { - var layout = LightDM.get_layout (); + var layout = LightDM.get_layout (); - var source = layout.name; - source = source.replace (" ", "+"); - source = source.replace ("\t", "+"); + var source = layout.name; + source = source.replace (" ", "+"); + source = source.replace ("\t", "+"); + if (!added.contains (source)) { list.add (source); + added.add (source); } var builder = new VariantBuilder (new VariantType ("a(ss)")); - foreach (var layout in list) { - builder.add ("(ss)", "xkb", layout); + foreach (var name in list) { + builder.add ("(ss)", "xkb", name); } source_settings.set_value ("sources", builder.end ()); -- cgit v1.2.3