Merge lp:~attente/indicator-keyboard/1256559 into lp:indicator-keyboard

Proposed by William Hua
Status: Merged
Approved by: William Hua
Approved revision: 281
Merged at revision: 284
Proposed branch: lp:~attente/indicator-keyboard/1256559
Merge into: lp:indicator-keyboard
Diff against target: 29 lines (+9/-3)
1 file modified
lib/main.vala (+9/-3)
To merge this branch: bzr merge lp:~attente/indicator-keyboard/1256559
Reviewer Review Type Date Requested Status
William Hua (community) Approve
Review via email: mp+207976@code.launchpad.net

Commit message

Do not set org.gnome.desktop.input-sources.current when unchanged (LP: #1256559).

Description of the change

Do not set org.gnome.desktop.input-sources.current when unchanged (LP: #1256559).

To post a comment you must log in.
Revision history for this message
William Hua (attente) wrote :

Tested and does seem to prevent unnecessary dconf writes.

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 2014-02-20 16:16:26 +0000
3+++ lib/main.vala 2014-02-24 17:02:42 +0000
4@@ -513,16 +513,22 @@
5
6 [DBus (visible = false)]
7 private void handle_focused_window_changed (uint window_id, string app_id, uint stage) {
8- ((!) window_sources)[focused_window_id] = source_settings.get_uint ("current");
9+ var old_current = source_settings.get_uint ("current");
10+
11+ ((!) window_sources)[focused_window_id] = old_current;
12
13 if (!(((!) window_sources).has_key (window_id))) {
14 var default_group = per_window_settings.get_int ("default-group");
15
16- if (default_group >= 0) {
17+ if (default_group >= 0 && default_group != old_current) {
18 source_settings.set_uint ("current", (uint) default_group);
19 }
20 } else {
21- source_settings.set_uint ("current", ((!) window_sources)[window_id]);
22+ var current = ((!) window_sources)[window_id];
23+
24+ if (current != old_current) {
25+ source_settings.set_uint ("current", current);
26+ }
27 }
28
29 focused_window_id = window_id;

Subscribers

People subscribed via source and target branches

to all changes: