From 2c13e51f5a639d5804f722216c1e036d469e59a1 Mon Sep 17 00:00:00 2001 From: charles kerr Date: Mon, 28 Dec 2015 17:05:42 -0600 Subject: fix regression that broke down-volume-button dismissing warning dialog --- src/volume-warning.vala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/volume-warning.vala b/src/volume-warning.vala index c36a3f7..6d8cbd5 100644 --- a/src/volume-warning.vala +++ b/src/volume-warning.vala @@ -42,8 +42,10 @@ public class VolumeWarning : Object } public void user_keypress(Key key) { - if (key == Key.VOLUME_DOWN) + if ((key == Key.VOLUME_DOWN) && active) { + _notification.close(); on_user_response(IndicatorSound.WarnNotification.Response.CANCEL); + } } public VolumeWarning (IndicatorSound.Options options, PulseAudio.GLibMainLoop pgloop) { @@ -393,12 +395,13 @@ public class VolumeWarning : Object private void on_user_response(IndicatorSound.WarnNotification.Response response) { + this.active = false; + if (response == IndicatorSound.WarnNotification.Response.OK) { approve_high_volume(); _set_multimedia_volume(_ok_volume); } _ok_volume = PulseAudio.Volume.INVALID; - this.active = false; } } -- cgit v1.2.3