diff options
author | William Hua <william.hua@canonical.com> | 2014-02-27 19:37:48 +0000 |
---|---|---|
committer | CI bot <ps-jenkins@lists.canonical.com> | 2014-02-27 19:37:48 +0000 |
commit | 7b3c032fa7e4f42b5fe4a3dc3b3409ecbf7baf2e (patch) | |
tree | d36fe9ce2c24aa96c232ca97f846a94ccc942ed6 | |
parent | 61c218ffc861a7a21253d78b8457e4517f88e593 (diff) | |
parent | 465800294ff2999b9d050a2d2d23be923edf74cc (diff) | |
download | ayatana-indicator-keyboard-7b3c032fa7e4f42b5fe4a3dc3b3409ecbf7baf2e.tar.gz ayatana-indicator-keyboard-7b3c032fa7e4f42b5fe4a3dc3b3409ecbf7baf2e.tar.bz2 ayatana-indicator-keyboard-7b3c032fa7e4f42b5fe4a3dc3b3409ecbf7baf2e.zip |
Do not set org.gnome.desktop.input-sources.current when unchanged (LP: #1256559). Fixes: 1256559
-rw-r--r-- | lib/main.vala | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/main.vala b/lib/main.vala index d16022e9..61036fd5 100644 --- a/lib/main.vala +++ b/lib/main.vala @@ -513,16 +513,22 @@ public class Indicator.Keyboard.Service : Object { [DBus (visible = false)] private void handle_focused_window_changed (uint window_id, string app_id, uint stage) { - ((!) window_sources)[focused_window_id] = source_settings.get_uint ("current"); + var old_current = source_settings.get_uint ("current"); + + ((!) window_sources)[focused_window_id] = old_current; if (!(((!) window_sources).has_key (window_id))) { var default_group = per_window_settings.get_int ("default-group"); - if (default_group >= 0) { + if (default_group >= 0 && default_group != old_current) { source_settings.set_uint ("current", (uint) default_group); } } else { - source_settings.set_uint ("current", ((!) window_sources)[window_id]); + var current = ((!) window_sources)[window_id]; + + if (current != old_current) { + source_settings.set_uint ("current", current); + } } focused_window_id = window_id; |