Merge lp:~laney/indicator-keyboard/lp1627057 into lp:indicator-keyboard

Proposed by Iain Lane
Status: Merged
Approved by: Iain Lane
Approved revision: 1104
Merged at revision: 1104
Proposed branch: lp:~laney/indicator-keyboard/lp1627057
Merge into: lp:indicator-keyboard
Diff against target: 43 lines (+23/-0)
1 file modified
lib/main.vala (+23/-0)
To merge this branch: bzr merge lp:~laney/indicator-keyboard/lp1627057
Reviewer Review Type Date Requested Status
Iain Lane Approve
William Hua Pending
Review via email: mp+308004@code.launchpad.net

Commit message

Don't clobber unity-settings-daemon's configured input sources when migrating from old configurations

Description of the change

See bug #1627057. I don't understand why this happens now, or why it would be linked to parts of the session being started by systemd, but it seems like i-keyboard is clobbering the values that u-s-d sets up.

To post a comment you must log in.
Revision history for this message
Iain Lane (laney) wrote :

(Self approving the MP, since none of the usual suspects are around today and I think this is important to have in the image. Sorry if this breaks things...)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/main.vala'
2--- lib/main.vala 2016-08-03 15:12:49 +0000
3+++ lib/main.vala 2016-10-09 13:26:05 +0000
4@@ -433,9 +433,26 @@
5 user_list.get_user_by_name ("");
6 } else {
7 if (!indicator_settings.get_boolean ("migrated")) {
8+ string[] seen_sources = {};
9 var builder = new VariantBuilder (new VariantType ("a(ss)"));
10 var length = 0;
11
12+ foreach (var pair in source_settings.get_value ("sources")) {
13+ unowned string source_type;
14+ unowned string source_name;
15+
16+ ((!) pair).get ("(&s&s)", out source_type, out source_name);
17+
18+ if (source_name in seen_sources)
19+ continue;
20+
21+ builder.add ("(ss)", source_type, source_name);
22+
23+ seen_sources += source_name;
24+
25+ length++;
26+ }
27+
28 var layout_settings = new Settings ("org.gnome.libgnomekbd.keyboard");
29 var layouts = layout_settings.get_strv ("layouts");
30
31@@ -444,7 +461,13 @@
32 source = source.replace (" ", "+");
33 source = source.replace ("\t", "+");
34
35+ if (source in seen_sources)
36+ continue;
37+
38 builder.add ("(ss)", "xkb", source);
39+
40+ seen_sources += source;
41+
42 length++;
43 }
44

Subscribers

People subscribed via source and target branches

to all changes: