From e3cec790e72af21793fada09b1554f76c195121d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 30 Jan 2015 08:57:03 -0600 Subject: Track output mode --- src/service.vala | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/service.vala') diff --git a/src/service.vala b/src/service.vala index fb56215..ba77ae8 100644 --- a/src/service.vala +++ b/src/service.vala @@ -270,6 +270,7 @@ public class IndicatorSound.Service: Object { private bool check_sync_notification = false; private bool support_sync_notification = false; + private string last_output_notification = "multimedia"; void update_sync_notification () { if (!check_sync_notification) { @@ -283,6 +284,13 @@ public class IndicatorSound.Service: Object { if (!support_sync_notification) return; + /* Suppress notifications of volume changes if it is because the + output stream changed. */ + var oldoutput = this.last_output_notification; + this.last_output_notification = this.volume_control.stream; + if (oldoutput != this.last_output_notification) + return; + var shown_action = actions.lookup_action ("indicator-shown") as SimpleAction; if (shown_action != null && shown_action.get_state().get_boolean()) return; -- cgit v1.2.3