From 1de841e8cab5b6d1df9eec4656a041877f7d6934 Mon Sep 17 00:00:00 2001 From: Pine Date: Thu, 14 May 2026 15:39:12 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BC=98=E5=8C=96=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 476547d..8bb6444 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -46,6 +46,12 @@ pub fn run() { tauri_plugin_autostart::MacosLauncher::LaunchAgent, Some(vec![]), )) + .on_window_event(|window, event| { + if let tauri::WindowEvent::CloseRequested { api, .. } = event { + api.prevent_close(); + let _ = window.minimize(); + } + }) .run(tauri::generate_context!()) .expect("error while running tauri application"); }