Fix audio volume icon

_volumeChanged should not update the icon if the sink is muted.
Fixes the case when shell is started with a muted sink (_mutedChanged
is called before _volumeChanged).

https://bugzilla.gnome.org/show_bug.cgi?id=632868
This commit is contained in:
Giovanni Campagna 2010-10-22 15:31:58 +02:00
parent 3dbee0b833
commit 6b47b78d4d

View File

@ -102,7 +102,6 @@ Indicator.prototype = {
this._outputVolumeId = this._output.connect('notify::volume', Lang.bind(this, this._volumeChanged, '_output'));
this._mutedChanged (null, null, '_output');
this._volumeChanged (null, null, '_output');
this.setIcon(this._volumeToIcon(this._output.volume));
} else {
this._outputSwitch.label.text = _("Output: Muted");
this._outputSwitch.setToggleState(false);
@ -208,7 +207,7 @@ Indicator.prototype = {
_volumeChanged: function(object, param_spec, property) {
this[property+'Slider'].setValue(this[property].volume / VOLUME_MAX);
this._updateLabel(property);
if (property == '_output')
if (property == '_output' && !this._output.is_muted)
this.setIcon(this._volumeToIcon(this._output.volume));
},