aboutsummaryrefslogtreecommitdiff
path: root/src/music-player-bridge.vala
diff options
context:
space:
mode:
Diffstat (limited to 'src/music-player-bridge.vala')
-rw-r--r--src/music-player-bridge.vala15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/music-player-bridge.vala b/src/music-player-bridge.vala
index 7587684..c6c9913 100644
--- a/src/music-player-bridge.vala
+++ b/src/music-player-bridge.vala
@@ -41,6 +41,17 @@ public class MusicPlayerBridge : GLib.Object
private void on_blacklist_update ( string[] blacklist )
{
debug("some blacklist update");
+
+ foreach(var s in blacklist){
+ string key = this.determine_key (s);
+ if (this.registered_clients.has_key (key)){
+ debug ("Apparently %s is now blacklisted - remove thy self", key);
+ this.registered_clients[key].remove_from_menu();
+ this.registered_clients.unset (key);
+ }
+ }
+ // double check present players to ensure dynamic removal/addition
+ this.watcher.check_for_active_clients.begin();
}
private void try_to_add_inactive_familiar_clients()
@@ -141,8 +152,8 @@ public class MusicPlayerBridge : GLib.Object
this.root_menu = menu;
this.try_to_add_inactive_familiar_clients();
this.watcher = new Mpris2Watcher ();
- this.watcher.client_appeared += this.client_has_become_available;
- this.watcher.client_disappeared += this.client_has_vanished;
+ this.watcher.client_appeared.connect (this.client_has_become_available);
+ this.watcher.client_disappeared.connect (this.client_has_vanished);
}
private static AppInfo? create_app_info ( string desktop )