From dea589f85ca99fbba60a67c008499d9824a852b9 Mon Sep 17 00:00:00 2001 From: Andreas Grois Date: Sun, 28 Nov 2021 23:49:19 +0100 Subject: 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. --- pulse/src/runnable/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pulse') 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 { -- cgit v1.2.3