diff --git a/UPDATELOG.md b/UPDATELOG.md index 898f22dc..f9a3302e 100644 --- a/UPDATELOG.md +++ b/UPDATELOG.md @@ -11,6 +11,7 @@ - 首页“代理模式”快速切换导致的卡死问题 - 解锁测试报错信息 - Macos 快捷键关闭窗口无法启用自动轻量模式 + - 静默启动异常窗口创建和关闭流程 ## v2.2.3 diff --git a/src-tauri/src/utils/resolve.rs b/src-tauri/src/utils/resolve.rs index f0ca11fb..261f0b04 100644 --- a/src-tauri/src/utils/resolve.rs +++ b/src-tauri/src/utils/resolve.rs @@ -123,6 +123,11 @@ pub async fn resolve_reset_async() { /// create main window pub fn create_window(is_showup: bool) { + if !is_showup { + logging!(info, Type::Window, "Not to display create window"); + return; + } + logging!(info, Type::Window, true, "Creating window"); let app_handle = handle::Handle::global().app_handle().unwrap(); @@ -196,17 +201,8 @@ pub fn create_window(is_showup: bool) { match window { Ok(window) => { logging!(info, Type::Window, true, "Window created successfully"); - if is_showup { - let _ = window.show(); - let _ = window.set_focus(); - } else { - let _ = window.hide(); - #[cfg(target_os = "macos")] - AppHandleManager::global().set_activation_policy_accessory(); - } - - // 设置窗口状态监控,实时保存窗口位置和大小 - // crate::feat::setup_window_state_monitor(&app_handle); + let _ = window.show(); + let _ = window.set_focus(); // 标记前端UI已准备就绪,向前端发送启动完成事件 let app_handle_clone = app_handle.clone();