From b584c75ef96e1d6bfa924f09b81440b4a5b3ca0a Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Fri, 19 Jun 2026 06:51:05 -0600 Subject: [PATCH] fix(slint): drive the lyrics sync engine for immersive lyrics panels The 30Hz lyrics engine gated solely on ShellState.lyrics-open (the sidebar), so the immersive Lyrics panels (focus + split) never advanced: active-index/line-progress stayed frozen and the open-time kick() no-op'd because it bailed at the same gate before computing. Widen the gate so the engine also ticks while an immersive lyrics panel is active (focus mode 4 or split panel 0), read directly from ImmersiveState. cc --- crates/qbz-slint/src/lyrics_sync.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/crates/qbz-slint/src/lyrics_sync.rs b/crates/qbz-slint/src/lyrics_sync.rs index 5def6aa08..c336843cd 100644 --- a/crates/qbz-slint/src/lyrics_sync.rs +++ b/crates/qbz-slint/src/lyrics_sync.rs @@ -53,7 +53,7 @@ use qbz_app::shell::AppRuntime; use crate::adapter::SlintAdapter; use crate::lyrics_measure; -use crate::{AppWindow, LyricsSegment, LyricsState, ShellState}; +use crate::{AppWindow, ImmersiveState, LyricsSegment, LyricsState, ShellState}; type Runtime = Arc>; @@ -194,8 +194,24 @@ fn resolve_position_ms(runtime: &Runtime) -> (u64, bool) { /// `LyricsState` — equality-guarded, animation zeroed across /// discontinuities. Returns whether the gate is fully open (open + synced + /// playing) so the caller can pick the cadence. +/// The sync engine ticks while ANY lyrics surface is showing: the main +/// sidebar (`ShellState.lyrics-open`) OR an immersive lyrics panel (FOCUS +/// mode 4, or SPLIT panel 0). The immersive panels reuse this same engine, so +/// without widening the gate it stayed sidebar-only and immersive lyrics froze +/// in place (`active-index`/`line-progress` never advanced, and the open-time +/// `kick()` no-op'd because it bails here before computing). +fn lyrics_surface_open(window: &AppWindow) -> bool { + if window.global::().get_lyrics_open() { + return true; + } + let imm = window.global::(); + imm.get_open() + && ((imm.get_view_mode() == 0 && imm.get_mode() == 4) + || (imm.get_view_mode() == 1 && imm.get_split_panel() == 0)) +} + fn compute_and_push(window: &AppWindow, runtime: &Runtime, require_playing: bool) -> bool { - if !window.global::().get_lyrics_open() { + if !lyrics_surface_open(window) { return false; } let lyrics = window.global::();