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
This commit is contained in:
Florian Müllner 2020-03-28 03:37:50 +01:00
parent ba8210ea98
commit 97fe4f761a

View File

@ -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();