refactor: simplify should_use_main_window_transparency

This commit is contained in:
Afonso Jorge Ramos committed 2026-03-20 01:15:28 +01:00
1 parent 6422ae8ff9
commit 379ba28cee
1 file changed
+3 -7
+3 -7
View File
@@ -493,13 +493,9 @@ fn should_use_main_window_transparency() -> bool {
// On macOS, transparent WKWebView causes severe rendering performance issues
// (every frame must be composited through the transparent background).
// Default to opaque unless explicitly requested.
let force_transparent = std::env::var("QBZ_FORCE_TRANSPARENT_WINDOWS")
.map(|value| {
let normalized = value.trim().to_ascii_lowercase();
normalized == "1" || normalized == "true" || normalized == "yes"
})
.unwrap_or(false);
force_transparent
std::env::var("QBZ_FORCE_TRANSPARENT_WINDOWS")
.map(|v| matches!(v.trim().to_ascii_lowercase().as_str(), "1" | "true" | "yes"))
.unwrap_or(false)
}
pub fn run() {