fix: restore window from tray when status bar icon is present

This commit is contained in:
wonfen
2025-06-17 12:59:05 +08:00
parent ac7307b1f7
commit a67e8388a9
2 changed files with 13 additions and 1 deletions

View File

@@ -307,8 +307,17 @@ pub fn create_window(is_show: bool) -> bool {
if let Some(window) = app_handle.get_webview_window("main") {
logging!(info, Type::Window, true, "主窗口已存在,将显示现有窗口");
if is_show {
if window.is_minimized().unwrap_or(false) {
logging!(info, Type::Window, true, "窗口已最小化,正在取消最小化");
let _ = window.unminimize();
}
let _ = window.show();
let _ = window.set_focus();
#[cfg(target_os = "macos")]
{
AppHandleManager::global().set_activation_policy_regular();
}
}
return true;
}