mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 17:15:38 +08:00
fix: improve Linux tray support and add --no-tray option (#4958)
This commit is contained in:
@@ -192,8 +192,18 @@ impl Tray {
|
||||
let app_handle = handle::Handle::global()
|
||||
.app_handle()
|
||||
.ok_or_else(|| anyhow::anyhow!("Failed to get app handle for tray initialization"))?;
|
||||
self.create_tray_from_handle(&app_handle).await?;
|
||||
Ok(())
|
||||
|
||||
match self.create_tray_from_handle(&app_handle).await {
|
||||
Ok(_) => {
|
||||
log::info!(target: "app", "System tray created successfully");
|
||||
Ok(())
|
||||
}
|
||||
Err(e) => {
|
||||
log::warn!(target: "app", "System tray creation failed: {}, Application will continue running without tray icon", e);
|
||||
// Don't return error, let application continue running without tray
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// 更新托盘点击行为
|
||||
|
||||
Reference in New Issue
Block a user