From 96a752e61d1e651d26713915dd7135b6c1f2e5e4 Mon Sep 17 00:00:00 2001 From: Breadway Date: Mon, 31 Aug 2026 21:57:54 +0800 Subject: [PATCH] fix: launcher overlay paints opaque @bg instead of transparent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The full-screen overlay window sets `window { background-color: transparent }` in its app CSS (APPLICATION priority), but `bind_window_auto` re-broadcasts the shared component sheet — which includes `window { background-color: @bg }` — as a widget-tree provider at STYLE_PROVIDER_PRIORITY_USER - 10. Provider priority is the primary cascade key, so that outranks the app rule regardless of selector specificity: the "transparent overlay" fills the screen with an opaque @bg (#0c0c0c) rectangle, hiding the whole desktop behind the launcher. Guaranteed to bite under a VM's software renderer where there's no GL context to paper over it. Bind the app sheet too, via bind_window_auto_with_app_css (rides at USER - 9, back above the shared window rule) — same pattern breadbar and breadhelp already use. Verified with a headless pixman sway + solid-colour background: the overlay region outside the panel now shows the desktop through. breadsearch and breadclip use the same new_overlay_window + bind_window_auto pattern and need the same fix. --- breadbox/src/main.rs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/breadbox/src/main.rs b/breadbox/src/main.rs index c8a639d..d6cbee2 100644 --- a/breadbox/src/main.rs +++ b/breadbox/src/main.rs @@ -236,9 +236,8 @@ fn run_ui( let shell_theme = theme::shell_theme(); let launcher = shell_theme.launcher().clone(); - // Shared ecosystem base (fonts, palette, generic widgets) first, then - // breadbox-specific CSS layered on top — both hot-reload on - // `bread-theme reload` (the closure re-reads the pywal palette). + // Shared ecosystem base (fonts, palette, generic widgets) as a + // display-level fallback; the real per-window sheet is bound below. bread_theme::gtk::apply_shared(); { let launcher = launcher.clone(); @@ -255,7 +254,22 @@ fn run_ui( // Full-screen transparent overlay; panel widget is positioned inside it. let window = bread_utils::gtk_popup::new_overlay_window(app, "breadbox"); - bread_theme::gtk::bind_window_auto(&window); + // Bind the *app* sheet — not just the shared one — as the widget-tree + // provider. `bind_window_auto` alone re-broadcasts the shared + // component sheet (which includes `window { background-color: @bg }`) + // at USER-10, outranking our APPLICATION-priority + // `window { background-color: transparent }` regardless of specificity + // — so the "transparent overlay" paints solid @bg and the launcher + // covers the screen in an opaque black rectangle (worse under a VM's + // software renderer, where there's no GL to mask it). `_with_app_css` + // rides our sheet at USER-9, back on top. + { + let launcher = launcher.clone(); + let tokens = shell_theme.tokens().clone(); + bread_theme::gtk::bind_window_auto_with_app_css(&window, move |p| { + build_css(p, &launcher, &tokens) + }); + } let close_all: Rc = Rc::new({ let w = window.clone();