fix: overlay paints opaque @bg; add a tracing subscriber
Same `bind_window_auto` clobber as breadbox / breadclip: the full-screen
overlay's `window { background-color: transparent }` (APPLICATION priority)
loses to the shared component sheet's `window { background-color: @bg }`,
re-broadcast at USER-10 by `bind_window_auto`, so the search popup fills the
whole screen with an opaque #0c0c0c rectangle. Switch to
`bind_window_auto_with_app_css` (rides at USER-9).
Also add a tracing subscriber to the `breadsearch` binary so bread-theme /
bread-utils `warn!`s aren't dropped (breadmill already had one).
This commit is contained in:
parent
993dc4a525
commit
54751ac1c9
3 changed files with 23 additions and 1 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -272,6 +272,7 @@ dependencies = [
|
|||
"gtk4",
|
||||
"gtk4-layer-shell",
|
||||
"serde_json",
|
||||
"tracing-subscriber",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
|||
|
|
@ -20,3 +20,6 @@ gtk4-layer-shell = "0.8"
|
|||
serde_json = "1"
|
||||
clap = { version = "4", features = ["derive"] }
|
||||
anyhow = "1"
|
||||
# Subscriber for bread-theme / bread-utils `tracing` events — dropped
|
||||
# silently without one. env-filter for RUST_LOG.
|
||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||
|
|
|
|||
|
|
@ -197,7 +197,15 @@ fn run_ui(screenshot_req: Option<screenshot::ScreenshotRequest>) {
|
|||
|
||||
// Full-screen transparent overlay; panel widget is positioned inside it.
|
||||
let window = bread_utils::gtk_popup::new_overlay_window(app, "breadsearch");
|
||||
bread_theme::gtk::bind_window_auto(&window);
|
||||
// Bind the *app* sheet, not just the shared one. `bind_window_auto`
|
||||
// alone re-broadcasts the shared component sheet — including
|
||||
// `window { background-color: @bg }` — at USER-10, outranking the
|
||||
// APPLICATION-priority `window { background-color: transparent }` here
|
||||
// regardless of specificity: the "transparent overlay" then paints a
|
||||
// solid @bg rectangle over the whole screen (worst under a VM's
|
||||
// software renderer). `_with_app_css` rides our sheet at USER-9. Same
|
||||
// fix as breadbox / breadclip.
|
||||
bread_theme::gtk::bind_window_auto_with_app_css(&window, build_css);
|
||||
|
||||
let close_all: Rc<dyn Fn()> = Rc::new({
|
||||
let w = window.clone();
|
||||
|
|
@ -369,6 +377,16 @@ fn run_ui(screenshot_req: Option<screenshot::ScreenshotRequest>) {
|
|||
// ---- Main -------------------------------------------------------------------
|
||||
|
||||
fn main() {
|
||||
// Surface bread-theme / bread-utils `tracing::warn!` (dropped silently
|
||||
// before). `RUST_LOG` overrides; default warn+.
|
||||
tracing_subscriber::fmt()
|
||||
.with_env_filter(
|
||||
tracing_subscriber::EnvFilter::try_from_default_env()
|
||||
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("warn")),
|
||||
)
|
||||
.with_writer(std::io::stderr)
|
||||
.init();
|
||||
|
||||
if std::env::args().nth(1).as_deref() == Some("listen") {
|
||||
listen::run();
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue