From 9f3a6f5f2f154ab264b8039e001a22ab401090b2 Mon Sep 17 00:00:00 2001 From: CJ Pais Date: Tue, 6 May 2025 12:28:43 -0700 Subject: [PATCH] fix window close bug --- src-tauri/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 18f2a57..3dd132a 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -150,10 +150,12 @@ pub fn run() { Ok(()) }) - .on_window_event(|app, event| match event { + .on_window_event(|window, event| match event { tauri::WindowEvent::CloseRequested { api, .. } => { - app.hide().unwrap(); api.prevent_close(); + + // TODO may be different on windows, this works for macos + tauri::AppHandle::hide(window.app_handle()).unwrap(); } _ => {} })