From 6feea025512a572179b041bd5c02d44b1f57adce Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 2 Feb 2015 17:03:16 -0600 Subject: Watch for double updates from notifications. Supress them --- src/service.vala | 7 +++++++ 1 file changed, 7 insertions(+) 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; -- cgit v1.2.3