aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Grois <andi@grois.info>2021-11-28 23:49:19 +0100
committerAndreas Grois <andi@grois.info>2021-11-28 23:49:19 +0100
commitdea589f85ca99fbba60a67c008499d9824a852b9 (patch)
tree1aecce67828489414aa3c530c73ca28aafd6ba27
parenta0457a3d4dcbf1060dbad850a915a3466575f665 (diff)
Fix handling of specific sinks with pulse.
Before the initial update was missing. By always querying the default sink we properly grab server data first, and trigger the update.
-rw-r--r--pulse/src/runnable/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/pulse/src/runnable/mod.rs b/pulse/src/runnable/mod.rs
index bb2456b..9b58be7 100644
--- a/pulse/src/runnable/mod.rs
+++ b/pulse/src/runnable/mod.rs
@@ -121,7 +121,7 @@ impl<'p> SwayStatusModuleRunnable for PulseVolumeRunnable<'p> {
continue 'outer;
}
PaContextState::Ready => {
- if sink_we_care_about.is_none() {
+ if curr_default_sink.is_none() {
//this may trigger several redundant refreshes, but it _should_ only happen
//during startup, so we don't really care.
context.refresh_default_sink();
@@ -141,9 +141,9 @@ impl<'p> SwayStatusModuleRunnable for PulseVolumeRunnable<'p> {
curr_default_sink = default_sink;
if let crate::config::Sink::Default = self.config.sink {
sink_we_care_about = curr_default_sink.clone();
- if let Some(s) = &sink_we_care_about {
- context.refresh_volume(s);
- }
+ }
+ if let Some(s) = &sink_we_care_about {
+ context.refresh_volume(s);
}
}
if volume.is_some() && volume != curr_volume {