[gnome-shell/wip/fmuellner/volume-change-feedback: 58/59] volume: Only emit sound feedback after volume changes
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/fmuellner/volume-change-feedback: 58/59] volume: Only emit sound feedback after volume changes
- Date: Mon, 16 Apr 2018 13:28:48 +0000 (UTC)
commit 5405a16de9cf2241fc7a261f703de550cf3028fa
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Feb 23 23:58:22 2018 +0100
volume: Only emit sound feedback after volume changes
gnome-settings-daemon doesn't play the volume change sound when
the volume stayed the same (that is, it is already at its maximum
or minimum). This looks like the right thing to do, so copy its
behavior.
https://gitlab.gnome.org/GNOME/gnome-shell/issues/53
js/ui/status/volume.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js
index 08fb1ccae..68d3804e0 100644
--- a/js/ui/status/volume.js
+++ b/js/ui/status/volume.js
@@ -117,6 +117,7 @@ var StreamSlider = new Lang.Class({
let volume = value * this._control.get_vol_max_norm();
let prevMuted = this._stream.is_muted;
+ let prevVolume = this._stream.volume;
if (volume < 1) {
this._stream.volume = 0;
if (!prevMuted)
@@ -128,7 +129,8 @@ var StreamSlider = new Lang.Class({
}
this._stream.push_volume();
- if (!this._notifyVolumeChangeId && !this._inDrag)
+ let volumeChanged = this._stream.volume != prevVolume;
+ if (volumeChanged && !this._notifyVolumeChangeId && !this._inDrag)
this._notifyVolumeChangeId = Mainloop.timeout_add(30, () => {
this._notifyVolumeChange();
this._notifyVolumeChangeId = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]