diff options
author | Ted Gould <ted@gould.cx> | 2015-02-13 13:48:31 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2015-02-13 13:48:31 -0600 |
commit | eb8a797c9e7ce01e3345edc20db1486764c84d08 (patch) | |
tree | da361ad41c33233413e088c9b85dba3f3e2b95be /src | |
parent | 0a8a0f7185b4082ea189c43bc2e02eee506a623f (diff) | |
download | ayatana-indicator-sound-eb8a797c9e7ce01e3345edc20db1486764c84d08.tar.gz ayatana-indicator-sound-eb8a797c9e7ce01e3345edc20db1486764c84d08.tar.bz2 ayatana-indicator-sound-eb8a797c9e7ce01e3345edc20db1486764c84d08.zip |
Block notifications in the volume event instead of in the notification one so that high volume warnings can get through
Diffstat (limited to 'src')
-rw-r--r-- | src/service.vala | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/service.vala b/src/service.vala index 0b03b6e..14a49da 100644 --- a/src/service.vala +++ b/src/service.vala @@ -299,21 +299,6 @@ public class IndicatorSound.Service: Object { if (!support_sync_notification) return; - /* Update our volume and output */ - var oldoutput = this.last_output_notification; - this.last_output_notification = this.volume_control.stream; - - var oldvolume = this.last_volume_notification; - this.last_volume_notification = volume_control.volume; - - /* Suppress notifications of volume changes if it is because the - output stream changed. */ - if (oldoutput != this.last_output_notification) - return; - /* Supress updates that don't change the value */ - if (GLib.Math.fabs(oldvolume - this.last_volume_notification) < 0.01) - return; - var shown_action = actions.lookup_action ("indicator-shown") as SimpleAction; if (shown_action != null && shown_action.get_state().get_boolean()) return; @@ -461,6 +446,22 @@ public class IndicatorSound.Service: Object { volume_action.set_state (new Variant.double (this.volume_control.volume / this.max_volume)); this.update_root_icon (); + + /* Update our volume and output */ + var oldoutput = this.last_output_notification; + this.last_output_notification = this.volume_control.stream; + + var oldvolume = this.last_volume_notification; + this.last_volume_notification = volume_control.volume; + + /* Suppress notifications of volume changes if it is because the + output stream changed. */ + if (oldoutput != this.last_output_notification) + return; + /* Supress updates that don't change the value */ + if (GLib.Math.fabs(oldvolume - this.last_volume_notification) < 0.01) + return; + this.update_sync_notification (); }); |