fix: restore window on tray click after close on Windows

This commit is contained in:
wonfen
2025-05-10 17:25:42 +08:00
parent 050b363066
commit 9a666d807c

View File

@@ -254,10 +254,21 @@ pub fn create_window(is_show: bool) -> bool {
info, info,
Type::Window, Type::Window,
true, true,
"开始创建主窗口, is_show={}", "开始创建/显示主窗口, is_show={}",
is_show is_show
); );
if let Some(app_handle) = handle::Handle::global().app_handle() {
if let Some(window) = app_handle.get_webview_window("main") {
logging!(info, Type::Window, true, "主窗口已存在,将显示现有窗口");
if is_show {
let _ = window.show();
let _ = window.set_focus();
}
return true;
}
}
let creating_lock = get_window_creating_lock(); let creating_lock = get_window_creating_lock();
let mut creating = creating_lock.lock(); let mut creating = creating_lock.lock();