diff options
author | Ted Gould <ted@gould.cx> | 2015-04-21 23:46:44 +0000 |
---|---|---|
committer | CI Train Bot <ci-train-bot@canonical.com> | 2015-04-21 23:46:44 +0000 |
commit | ccce28c257538f938d9ed4d4e0e01197911d4c9f (patch) | |
tree | 42fe76da26bb2125a12a4c055049775e1bae4eeb | |
parent | 549069be2aaee5f13a4fa56539ef4a8ece972e8b (diff) | |
parent | dc40dae539f83561a55a68424596243d3bd258f3 (diff) | |
download | ayatana-indicator-sound-ccce28c257538f938d9ed4d4e0e01197911d4c9f.tar.gz ayatana-indicator-sound-ccce28c257538f938d9ed4d4e0e01197911d4c9f.tar.bz2 ayatana-indicator-sound-ccce28c257538f938d9ed4d4e0e01197911d4c9f.zip |
Always record the volume whether we do something with it or not (LP: #1446703)
Approved by: Ricardo Salveti, PS Jenkins bot
-rw-r--r-- | src/volume-control-pulse.vala | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/volume-control-pulse.vala b/src/volume-control-pulse.vala index 050318b..3d4d113 100644 --- a/src/volume-control-pulse.vala +++ b/src/volume-control-pulse.vala @@ -616,25 +616,27 @@ public class VolumeControlPulse : VolumeControl return _volume; } set { - if (value.volume != _volume.volume) { - debug("Setting volume to %f for profile %d because %d", value.volume, _active_sink_input, value.reason); - - var old_high_volume = this.high_volume; - _volume = value; - - /* Make sure we're connected to Pulse and pulse didn't give us the change */ - if (context.get_state () == Context.State.READY && - _volume.reason != VolumeControl.VolumeReasons.PULSE_CHANGE) - if (_pulse_use_stream_restore) - set_volume_active_role.begin (); - else - context.get_server_info (server_info_cb_for_set_volume); + var volume_changed = (value.volume != _volume.volume); + debug("Setting volume to %f for profile %d because %d", value.volume, _active_sink_input, value.reason); + + var old_high_volume = this.high_volume; + _volume = value; + + /* Make sure we're connected to Pulse and pulse didn't give us the change */ + if (context.get_state () == Context.State.READY && + _volume.reason != VolumeControl.VolumeReasons.PULSE_CHANGE && + volume_changed) + if (_pulse_use_stream_restore) + set_volume_active_role.begin (); + else + context.get_server_info (server_info_cb_for_set_volume); - if (this.high_volume != old_high_volume) - this.notify_property("high-volume"); + if (this.high_volume != old_high_volume) + this.notify_property("high-volume"); - if (volume.reason != VolumeControl.VolumeReasons.ACCOUNTS_SERVICE_SET) - start_local_volume_timer(); + if (volume.reason != VolumeControl.VolumeReasons.ACCOUNTS_SERVICE_SET + && volume_changed) { + start_local_volume_timer(); } } } |