Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

fix: hide to tray instead of quitting when clicking close button

hairyf70699d60b188
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index 2f74168b..ae497939 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -112,6 +112,13 @@ fn handler() -> impl Fn(Invoke<Wry>) -> bool + Send + Sync + 'static {
// configure tauri builder
fn builder() -> tauri::Builder<tauri::Wry> {
tauri::Builder::default()
+ // 点击关闭按钮时隐藏到托盘而不是退出程序
+ .on_window_event(|window, event| {
+ if let tauri::WindowEvent::CloseRequested { api, .. } = event {
+ api.prevent_close();
+ let _ = window.hide();
+ }
+ })
// Opener plugin
.plugin(tauri_plugin_opener::init())
// FS plugin