aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hua <william.hua@canonical.com>2013-10-09 11:23:21 -0400
committerWilliam Hua <william.hua@canonical.com>2013-10-09 11:23:21 -0400
commit96ba3bfeba7badbce1a5f3592f6317a5657a324f (patch)
treea83a6e3e62cc23300de73e54d2bffecdc010f433
parent45f0066c39996a8ef4c3d4afabde4e6134f77d15 (diff)
downloadayatana-indicator-keyboard-96ba3bfeba7badbce1a5f3592f6317a5657a324f.tar.gz
ayatana-indicator-keyboard-96ba3bfeba7badbce1a5f3592f6317a5657a324f.tar.bz2
ayatana-indicator-keyboard-96ba3bfeba7badbce1a5f3592f6317a5657a324f.zip
Don't set LightDM's layout if we're in a session. (LP: 1226962)
-rw-r--r--lib/main.vala32
1 files changed, 17 insertions, 15 deletions
diff --git a/lib/main.vala b/lib/main.vala
index 190276f8..195ee140 100644
--- a/lib/main.vala
+++ b/lib/main.vala
@@ -436,24 +436,26 @@ public class Indicator.Keyboard.Service : Object {
[DBus (visible = false)]
private void update_login_layout () {
- unowned List<LightDM.Layout> layouts = LightDM.get_layouts ();
- var current = source_settings.get_uint ("current");
+ if (is_login_user ()) {
+ unowned List<LightDM.Layout> layouts = LightDM.get_layouts ();
+ var current = source_settings.get_uint ("current");
- if (current < get_sources ().length) {
- var source = get_sources ()[current];
- string? name = null;
+ if (current < get_sources ().length) {
+ var source = get_sources ()[current];
+ string? name = null;
- if (source.layout != null && source.variant != null) {
- name = @"$((!) source.layout)\t$((!) source.variant)";
- } else if (source.layout != null) {
- name = source.layout;
- }
+ if (source.layout != null && source.variant != null) {
+ name = @"$((!) source.layout)\t$((!) source.variant)";
+ } else if (source.layout != null) {
+ name = source.layout;
+ }
- if (name != null) {
- foreach (var layout in layouts) {
- if (layout.name == (!) name) {
- LightDM.set_layout (layout);
- break;
+ if (name != null) {
+ foreach (var layout in layouts) {
+ if (layout.name == (!) name) {
+ LightDM.set_layout (layout);
+ break;
+ }
}
}
}