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:
1 file changed
+6
-2
@@ -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
|
||||
// cover resolves.
|
||||
np.set_artwork_large(slint::Image::default());
|
||||
w.global::<ImmersiveState>()
|
||||
.set_bg_image(slint::Image::default());
|
||||
// Do NOT clear the immersive atmosphere bg here. Blanking it caused a
|
||||
// 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);
|
||||
|
||||
Reference in new issue
Block a user