diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2024-12-21 22:57:10 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2024-12-21 22:57:10 +0100 |
commit | 3311762563992fecb602ec2f7318a80d558a5e9e (patch) | |
tree | 1a74a6557a3a0bc08628174054a1e6b20a9e2b3f | |
parent | 4b2675d75d2c5ccaee3cc14adca4fa52dedf0abc (diff) | |
parent | 9ff7a9005899297fed9f261c122efc1e0f36d214 (diff) | |
download | ayatana-indicator-sound-3311762563992fecb602ec2f7318a80d558a5e9e.tar.gz ayatana-indicator-sound-3311762563992fecb602ec2f7318a80d558a5e9e.tar.bz2 ayatana-indicator-sound-3311762563992fecb602ec2f7318a80d558a5e9e.zip |
Merge branch 'tari01-pr/volume-change-unmute'
Attributes GH PR #107: https://github.com/AyatanaIndicators/ayatana-indicator-sound/pull/107
-rw-r--r-- | src/service.vala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/service.vala b/src/service.vala index 5fbc8e9..fdc27fd 100644 --- a/src/service.vala +++ b/src/service.vala @@ -226,6 +226,12 @@ public class IndicatorSound.Service: Object { } else { double delta = volume_step_percentage * direction; double v = volume_control.volume.volume + delta; + + if (v > 0.0 && volume_control.mute == true) + { + volume_control.set_mute (false); + } + volume_control.set_volume_clamp (v, VolumeControl.VolumeReasons.USER_KEYPRESS); } } @@ -438,6 +444,12 @@ public class IndicatorSound.Service: Object { volume_action.change_state.connect ( (action, val) => { double v = val.get_double () * _options.max_volume; + + if (v > 0.0 && volume_control.mute == true) + { + volume_control.set_mute (false); + } + volume_control.set_volume_clamp (v, VolumeControl.VolumeReasons.USER_KEYPRESS); }); |