From 97fe4f761a194682c9d1597f364a0476f04ff324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 28 Mar 2020 03:37:50 +0100 Subject: [PATCH] volume: Cancel before checking state Since commit 2894085c45 we omit sound feedback on volume changes if something is already outputting sound. Unfortunately that "something" may be our own feedback (from a previous volume change). In that case we do not want to omit the new feedback, so instead cancel the previous one. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1147 --- js/ui/status/volume.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js index 434dcfbf7..e8a787c4d 100644 --- a/js/ui/status/volume.js +++ b/js/ui/status/volume.js @@ -138,11 +138,12 @@ var StreamSlider = class { } _notifyVolumeChange() { - if (this._stream.state === Gvc.MixerStreamState.RUNNING) - return; // feedback not necessary while playing - if (this._volumeCancellable) this._volumeCancellable.cancel(); + this._volumeCancellable = null; + + if (this._stream.state === Gvc.MixerStreamState.RUNNING) + return; // feedback not necessary while playing this._volumeCancellable = new Gio.Cancellable(); let player = global.display.get_sound_player();