aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-12-03 10:32:44 -0600
committerTed Gould <ted@gould.cx>2014-12-03 10:32:44 -0600
commit31cef82276a7f6b36b9128abc770d1b6b07fffe5 (patch)
tree8aeccbdf8f0713c53669c4754d6a7e6eb472bba7
parent57982f343b03175c20a4b51ccb5c853588613935 (diff)
downloadayatana-indicator-sound-31cef82276a7f6b36b9128abc770d1b6b07fffe5.tar.gz
ayatana-indicator-sound-31cef82276a7f6b36b9128abc770d1b6b07fffe5.tar.bz2
ayatana-indicator-sound-31cef82276a7f6b36b9128abc770d1b6b07fffe5.zip
Hide notification when the menu is shown
-rw-r--r--src/service.vala12
1 files changed, 12 insertions, 0 deletions
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() {