mpris: stop position timer when control center is hidden

parent 171fe2e9
......@@ -265,6 +265,12 @@ namespace XimperShellNotificationCenter.Widgets.Mpris {
carousel.get_nth_page (position), true);
}
public override void on_cc_visibility_change (bool val) {
players.foreach ((name, player) => {
player.set_cc_visible (val);
});
}
private bool is_blacklisted (string name) {
foreach (string blacklistedPattern in mpris_config.blacklist) {
if (blacklistedPattern == null || blacklistedPattern.length == 0) {
......
......@@ -221,6 +221,14 @@ namespace XimperShellNotificationCenter.Widgets.Mpris {
}
}
public void set_cc_visible (bool visible) {
if (visible) {
sync_playback_timer ();
} else {
stop_position_timer ();
}
}
public void before_destroy () {
stop_position_timer ();
source.properties_changed.disconnect (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment