[gnome-shell] volume: Cancel before checking state



commit 97fe4f761a194682c9d1597f364a0476f04ff324
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Mar 28 03:37:50 2020 +0100

    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 434dcfbf7f..e8a787c4de 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();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]