aboutsummaryrefslogtreecommitdiff
path: root/src/volume-control-pulse.vala
diff options
context:
space:
mode:
authorRicardo Salveti de Araujo <ricardo.salveti@canonical.com>2015-04-12 01:10:38 -0300
committerRicardo Salveti de Araujo <ricardo.salveti@canonical.com>2015-04-12 01:10:38 -0300
commitb19a15c9dc97e1c86d73fd7e4b933c79fa4737c3 (patch)
treeed7e45a8200eaea51c6c3543c8adcc95dcdd6218 /src/volume-control-pulse.vala
parentab570ba3084464ea9cefef32b0262775642ac748 (diff)
downloadayatana-indicator-sound-b19a15c9dc97e1c86d73fd7e4b933c79fa4737c3.tar.gz
ayatana-indicator-sound-b19a15c9dc97e1c86d73fd7e4b933c79fa4737c3.tar.bz2
ayatana-indicator-sound-b19a15c9dc97e1c86d73fd7e4b933c79fa4737c3.zip
volume-control-pulse: only set volume if value is indeed different and reason not from AS
Diffstat (limited to 'src/volume-control-pulse.vala')
-rw-r--r--src/volume-control-pulse.vala29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/volume-control-pulse.vala b/src/volume-control-pulse.vala
index 76368f2..f162685 100644
--- a/src/volume-control-pulse.vala
+++ b/src/volume-control-pulse.vala
@@ -608,23 +608,26 @@ public class VolumeControlPulse : VolumeControl
return _volume;
}
set {
- debug("Setting volume to %f for profile %d because %d", value.volume, _active_sink_input, value.reason);
+ 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;
+ 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);
+ /* 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);
- if (this.high_volume != old_high_volume)
- this.notify_property("high-volume");
+ if (this.high_volume != old_high_volume)
+ this.notify_property("high-volume");
- start_local_volume_timer();
+ if (volume.reason != VolumeControl.VolumeReasons.ACCOUNTS_SERVICE_SET)
+ start_local_volume_timer();
+ }
}
}