fix(slint): no background flicker on click-driven track change

refresh_now_playing_meta cleared ImmersiveState.bg-image (set default) on every
track change; the async 300px decode+blur then re-set it a beat later, so the
immersive atmosphere blanked then reappeared. Natural advances hid it (warm
art), but a click (cover or next button) showed the flicker.

Stop clearing bg-image on track change: the previous blurred ambient bg now
persists until load_now_playing_artwork_large swaps in the new one — a brief
stale blur is imperceptible; a blank is not.

cc
This commit is contained in:
vicrodh committed 2026-06-14 04:13:01 -06:00
1 parent 421e84c571
commit 25512d0d00
1 file changed
+6 -2
+6 -2
View File
@@ -1484,8 +1484,12 @@ pub(crate) async fn refresh_now_playing_meta(runtime: &Runtime, weak: &slint::We
// floating preview never shows the previous track while the new high-res // floating preview never shows the previous track while the new high-res
// cover resolves. // cover resolves.
np.set_artwork_large(slint::Image::default()); np.set_artwork_large(slint::Image::default());
w.global::<ImmersiveState>() // Do NOT clear the immersive atmosphere bg here. Blanking it caused a
.set_bg_image(slint::Image::default()); // visible BACKGROUND FLICKER on a click-driven track change (the async
// 300px decode + blur takes a beat, so the bg went blank then back).
// Let the previous blurred ambient bg persist until
// load_now_playing_artwork_large swaps in the new one — a brief stale
// blur is imperceptible; a blank/raw-cover fallback is not.
}); });
load_now_playing_artwork(weak.clone(), bar_artwork); load_now_playing_artwork(weak.clone(), bar_artwork);