Skip to content

Commit

Permalink
fix(sound): volume debounce not applied
Browse files Browse the repository at this point in the history
  • Loading branch information
l-const authored Oct 22, 2024
1 parent b8f0be5 commit 1222cbb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cosmic-settings/src/pages/sound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ impl Page {
let mut command = None;
if let Some(&node_id) = self.source_ids.get(self.active_source.unwrap_or(0)) {
command = Some(cosmic::command::future(async move {
tokio::time::sleep(Duration::from_millis(500)).await;
tokio::time::sleep(Duration::from_millis(64)).await;
crate::pages::Message::Sound(Message::SourceVolumeApply(node_id))
}));
}
Expand All @@ -316,7 +316,7 @@ impl Page {
}

Message::Pulse(pulse::Event::SourceVolume(volume)) => {
if self.sink_volume_debounce {
if self.source_volume_debounce {
return Command::none();
}

Expand All @@ -334,13 +334,13 @@ impl Page {
let mut command = None;
if let Some(&node_id) = self.sink_ids.get(self.active_sink.unwrap_or(0)) {
command = Some(cosmic::command::future(async move {
tokio::time::sleep(Duration::from_millis(500)).await;
tokio::time::sleep(Duration::from_millis(64)).await;
crate::pages::Message::Sound(Message::SinkVolumeApply(node_id))
}));
}

if let Some(command) = command {
self.source_volume_debounce = true;
self.sink_volume_debounce = true;
return command;
}
}
Expand Down

0 comments on commit 1222cbb

Please sign in to comment.