aboutsummaryrefslogtreecommitdiff
path: root/src/volume-control.vala
diff options
context:
space:
mode:
authorNick Dedekind <nicholas.dedekind@gmail.com>2014-04-16 21:55:04 +0100
committerNick Dedekind <nicholas.dedekind@gmail.com>2014-04-16 21:55:04 +0100
commit3c9c5f55e8a876fba36f2cd1f36cf2a5881f5846 (patch)
tree980e509133b19f3241a0914bed6afa73042e96ef /src/volume-control.vala
parentad57381fcfd07795691f50e4d51806fda8df4fa8 (diff)
downloadayatana-indicator-sound-3c9c5f55e8a876fba36f2cd1f36cf2a5881f5846.tar.gz
ayatana-indicator-sound-3c9c5f55e8a876fba36f2cd1f36cf2a5881f5846.tar.bz2
ayatana-indicator-sound-3c9c5f55e8a876fba36f2cd1f36cf2a5881f5846.zip
review changes
Diffstat (limited to 'src/volume-control.vala')
-rw-r--r--src/volume-control.vala15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/volume-control.vala b/src/volume-control.vala
index 8312cd6..ccc81d1 100644
--- a/src/volume-control.vala
+++ b/src/volume-control.vala
@@ -501,6 +501,9 @@ public class VolumeControl : Object
{
// perform a slow sync with the accounts service. max at 1 per second.
+ // stop the AS update timer, as since we're going to be setting the volume.
+ stop_account_service_volume_timer();
+
if (_local_volume_timer == 0) {
sync_volume_to_accountsservice.begin (_volume);
_local_volume_timer = Timeout.add_seconds (1, local_volume_changed_timeout);
@@ -532,7 +535,7 @@ public class VolumeControl : Object
private void start_account_service_volume_timer()
{
stop_account_service_volume_timer();
- _accountservice_volume_timer = Timeout.add_seconds (2, accountservice_volume_changed_timeout);
+ _accountservice_volume_timer = Timeout.add_seconds (1, accountservice_volume_changed_timeout);
}
private void stop_account_service_volume_timer()
@@ -545,12 +548,8 @@ public class VolumeControl : Object
bool accountservice_volume_changed_timeout ()
{
- // if the local value hasn't changed.
- if (_local_volume_timer == 0) {
- _accountservice_volume_timer = 0;
- set_volume_internal (_account_service_volume);
- return false; // G_SOURCE_REMOVE
- }
- return true; // G_SOURCE_CONTINUE
+ _accountservice_volume_timer = 0;
+ set_volume_internal (_account_service_volume);
+ return false; // G_SOURCE_REMOVE
}
}