diff options
author | Ted Gould <ted@gould.cx> | 2015-01-30 08:57:03 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2015-01-30 08:57:03 -0600 |
commit | e3cec790e72af21793fada09b1554f76c195121d (patch) | |
tree | 5b8a34ef9f17d6a06e517a1e24006a8c8543d41a /src/service.vala | |
parent | 59dfdd3906fd238e5ea3606d72b938677096e2c5 (diff) | |
download | ayatana-indicator-sound-e3cec790e72af21793fada09b1554f76c195121d.tar.gz ayatana-indicator-sound-e3cec790e72af21793fada09b1554f76c195121d.tar.bz2 ayatana-indicator-sound-e3cec790e72af21793fada09b1554f76c195121d.zip |
Track output mode
Diffstat (limited to 'src/service.vala')
-rw-r--r-- | src/service.vala | 8 |
1 files changed, 8 insertions, 0 deletions
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; |