diff options
author | Ted Gould <ted@gould.cx> | 2015-02-02 17:03:16 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2015-02-02 17:03:16 -0600 |
commit | 6feea025512a572179b041bd5c02d44b1f57adce (patch) | |
tree | 7d6ad2b4ddfa372c907af680b2620031d2df4548 /src | |
parent | e3cec790e72af21793fada09b1554f76c195121d (diff) | |
download | ayatana-indicator-sound-6feea025512a572179b041bd5c02d44b1f57adce.tar.gz ayatana-indicator-sound-6feea025512a572179b041bd5c02d44b1f57adce.tar.bz2 ayatana-indicator-sound-6feea025512a572179b041bd5c02d44b1f57adce.zip |
Watch for double updates from notifications. Supress them
Diffstat (limited to 'src')
-rw-r--r-- | src/service.vala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/service.vala b/src/service.vala index ba77ae8..da6b824 100644 --- a/src/service.vala +++ b/src/service.vala @@ -271,6 +271,7 @@ public class IndicatorSound.Service: Object { private bool check_sync_notification = false; private bool support_sync_notification = false; private string last_output_notification = "multimedia"; + private string last_volume_notification = 0; void update_sync_notification () { if (!check_sync_notification) { @@ -291,6 +292,12 @@ public class IndicatorSound.Service: Object { if (oldoutput != this.last_output_notification) return; + /* Supress updates that don't change the value */ + var oldvolume = this.last_volume_notification; + this.last_volume_notification = volume_control.volume; + if (oldvolume == this.last_volume_notification) + return; + var shown_action = actions.lookup_action ("indicator-shown") as SimpleAction; if (shown_action != null && shown_action.get_state().get_boolean()) return; |