From 09cfd9f09e452a0a92d56488e001a98a405ad296 Mon Sep 17 00:00:00 2001 From: Mike Solar Date: Fri, 21 Aug 2026 02:47:39 +0800 Subject: [PATCH] fix(ui): don't bump the display-color generation on the first build The first processor build has no prior state to be stale against; the spurious bump made the next cpu_frame call drop the freshly cached image (playback_display_tracks_the_playhead regression). --- src/oakui/displaycolor.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/oakui/displaycolor.rs b/src/oakui/displaycolor.rs index a826110aa..6eba3f02a 100644 --- a/src/oakui/displaycolor.rs +++ b/src/oakui/displaycolor.rs @@ -99,7 +99,12 @@ fn current() -> Option { } // The key changed: everything rendered with the old transform is // stale — bump the generation so frame caches drop their contents. - GENERATION.fetch_add(1, std::sync::atomic::Ordering::Relaxed); + // The FIRST build (no prior state) must not bump: no frame can be + // staler than a transform that did not exist yet, and a spurious + // bump would drop the frames being cached right now. + if guard.is_some() { + GENERATION.fetch_add(1, std::sync::atomic::Ordering::Relaxed); + } let (mode, icc_path, space) = &key; if mode != "icc" { let state = State {