From a050e6394adad88c420115ff8a61d7a62e9191c6 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Wed, 1 Jul 2026 19:46:14 -0600 Subject: [PATCH] fix: hide shader scenes on non-wgpu renderer tiers The immersive shader scenes (Plasma/Tunnel/Aurora/Spectral Ribbon/Line Bed) render through the wgpu underlay, which does not exist on the femtovg-GL and software tiers - picking one there showed a black view. Gate the five picker rows and the g-cycle behind a new ImmersiveState.shader-scenes-available flag seeded from the renderer selection; FOCUS views and splits (Slint-drawn) stay available. cc --- .../qbz-ui/ui/immersive/ImmersiveView.slint | 20 ++++++++++++------- crates/qbz-ui/ui/state.slint | 7 +++++++ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/crates/qbz-ui/ui/immersive/ImmersiveView.slint b/crates/qbz-ui/ui/immersive/ImmersiveView.slint index 6f5defcc6..6adf03bb4 100644 --- a/crates/qbz-ui/ui/immersive/ImmersiveView.slint +++ b/crates/qbz-ui/ui/immersive/ImmersiveView.slint @@ -628,7 +628,10 @@ component ImmersiveViewMenuPopup inherits PopupWindow { root.picked(); } } - ImmersiveMenuRow { + // Shader scenes need the wgpu underlay — on the femtovg-GL / + // software tiers they render black, so the whole group is hidden + // (ImmersiveState.shader-scenes-available is seeded from Rust). + if ImmersiveState.shader-scenes-available: ImmersiveMenuRow { icon: @image-url("../assets/icons/chart-no-axes-column.svg"); label: @tr("Plasma"); active: root.is-focus && root.sh == 1; @@ -637,7 +640,7 @@ component ImmersiveViewMenuPopup inherits PopupWindow { root.picked(); } } - ImmersiveMenuRow { + if ImmersiveState.shader-scenes-available: ImmersiveMenuRow { icon: @image-url("../assets/icons/disc-3.svg"); label: @tr("Tunnel"); active: root.is-focus && root.sh == 2; @@ -646,7 +649,7 @@ component ImmersiveViewMenuPopup inherits PopupWindow { root.picked(); } } - ImmersiveMenuRow { + if ImmersiveState.shader-scenes-available: ImmersiveMenuRow { icon: @image-url("../assets/icons/audio-lines.svg"); label: @tr("Aurora"); active: root.is-focus && root.sh == 3; @@ -655,7 +658,7 @@ component ImmersiveViewMenuPopup inherits PopupWindow { root.picked(); } } - ImmersiveMenuRow { + if ImmersiveState.shader-scenes-available: ImmersiveMenuRow { icon: @image-url("../assets/icons/chart-no-axes-column.svg"); label: @tr("Spectral Ribbon"); active: root.is-focus && root.sh == 4; @@ -664,7 +667,7 @@ component ImmersiveViewMenuPopup inherits PopupWindow { root.picked(); } } - ImmersiveMenuRow { + if ImmersiveState.shader-scenes-available: ImmersiveMenuRow { icon: @image-url("../assets/icons/radio.svg"); label: @tr("Line Bed"); active: root.is-focus && root.sh == 5; @@ -1191,9 +1194,12 @@ export component ImmersiveView inherits Rectangle { // Aurora -> Spectral Ribbon -> Line Bed -> Off). Liquid Spectrum (mode // 6) is a PARKED POC — to bring it back, change the Math.mod to 7 and // uncomment its picker row above. The header picker is the discoverable control. + // No-op on the GL/software tiers (no wgpu underlay = black scenes). if (event.text == "g" || event.text == "G") { - ImmersiveState.shader-mode = Math.mod(ImmersiveState.shader-mode + 1, 6); - root.wake(); + if (ImmersiveState.shader-scenes-available) { + ImmersiveState.shader-mode = Math.mod(ImmersiveState.shader-mode + 1, 6); + root.wake(); + } return accept; } return reject; diff --git a/crates/qbz-ui/ui/state.slint b/crates/qbz-ui/ui/state.slint index 9177f45ef..76cf18dff 100644 --- a/crates/qbz-ui/ui/state.slint +++ b/crates/qbz-ui/ui/state.slint @@ -1200,6 +1200,9 @@ export global LocalLibraryActions { // Albums bulk bar action: select-all | clear | queue | play-next | // add-to-playlist | add-to-mixtape. callback albums-bulk-action(string /* action */); + // Windowed grid: the visible row band changed (item indices into + // albums-visible, prefetch margin included) — dispatch artwork for it. + callback albums-window-changed(int /* first */, int /* last */); // --- Tracks tab --- callback tracks-search(string /* query */); @@ -3797,6 +3800,10 @@ export global ImmersiveState { // 0->1->2->3->0 with the 'g' key. in property shader-texture; in-out property shader-mode: 0; + // False on the femtovg-GL / software renderer tiers (no wgpu underlay → + // shader scenes would render black). Seeded from Rust at startup; gates + // the picker rows and the `g` cycle in ImmersiveView. + in-out property shader-scenes-available: true; // --- Immersive search cortinilla (parallel to SearchState.cortinilla-*) --- // Albums/Artists/Playlists only; selecting ACTS ON PLAYBACK (per the Settings