From 31cef82276a7f6b36b9128abc770d1b6b07fffe5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 3 Dec 2014 10:32:44 -0600 Subject: Hide notification when the menu is shown --- src/service.vala | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/service.vala b/src/service.vala index 48b0cbe..dbf7d35 100644 --- a/src/service.vala +++ b/src/service.vala @@ -73,6 +73,18 @@ public class IndicatorSound.Service: Object { }); sharedsettings.bind ("allow-amplified-volume", this, "allow-amplified-volume", SettingsBindFlags.GET); + + /* Hide the notification when the menu is shown */ + var shown_action = actions.lookup_action ("indicator-shown") as SimpleAction; + shown_action.change_state.connect ((state) => { + if (state.get_boolean()) { + try { + sync_notification.close(); + } catch (Error e) { + warning("Unable to close synchronous volume notification: %s", e.message); + } + } + }); } ~Service() { -- cgit v1.2.3