aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWilliam Hua <william.hua@canonical.com>2014-08-27 09:50:05 -0400
committerWilliam Hua <william.hua@canonical.com>2014-08-27 09:50:05 -0400
commitc698f44730ab005b5905303b95d6273fc53899cd (patch)
tree627ac21143c36f21add348291f2b152bc44b75a3 /lib
parent3b90f374d282578fbbb2b4e950214e73ea81e4f7 (diff)
downloadayatana-indicator-keyboard-c698f44730ab005b5905303b95d6273fc53899cd.tar.gz
ayatana-indicator-keyboard-c698f44730ab005b5905303b95d6273fc53899cd.tar.bz2
ayatana-indicator-keyboard-c698f44730ab005b5905303b95d6273fc53899cd.zip
Forget window source when destroyed.
Diffstat (limited to 'lib')
-rw-r--r--lib/main.vala7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/main.vala b/lib/main.vala
index c05d0164..b8f34599 100644
--- a/lib/main.vala
+++ b/lib/main.vala
@@ -607,9 +607,11 @@ public class Indicator.Keyboard.Service : Object {
}
window_sources = new Gee.HashMap<uint, Source> ();
+ ((!) window_stack).window_destroyed.connect (handle_window_destroyed);
((!) window_stack).focused_window_changed.connect (handle_focused_window_changed);
} else {
((!) window_stack).focused_window_changed.disconnect (handle_focused_window_changed);
+ ((!) window_stack).window_destroyed.disconnect (handle_window_destroyed);
window_sources = null;
}
}
@@ -622,6 +624,11 @@ public class Indicator.Keyboard.Service : Object {
}
[DBus (visible = false)]
+ private void handle_window_destroyed (uint window_id, string app_id) {
+ ((!) window_sources).unset (window_id);
+ }
+
+ [DBus (visible = false)]
private void handle_focused_window_changed (uint window_id, string app_id, uint stage) {
var sources = get_sources ();
var old_current = source_settings.get_uint ("current");