fix: improve Linux tray support and add --no-tray option (#4958)

This commit is contained in:
Sline
2025-10-07 10:02:11 +08:00
committed by GitHub
parent c05395c258
commit d3477159a8
4 changed files with 47 additions and 2 deletions

View File

@@ -282,6 +282,21 @@ pub fn run() {
std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
}
// Force X11 backend for tray icon compatibility on Wayland
let is_wayland = std::env::var("WAYLAND_DISPLAY").is_ok();
if is_wayland {
unsafe {
std::env::set_var("GDK_BACKEND", "x11");
std::env::remove_var("WAYLAND_DISPLAY");
}
logging!(
info,
Type::Setup,
true,
"Wayland detected: Forcing X11 backend for tray icon compatibility"
);
}
let desktop_env = std::env::var("XDG_CURRENT_DESKTOP")
.unwrap_or_default()
.to_uppercase();