🐛 debug windows

This commit is contained in:
Tw93
2024-12-21 22:43:08 +08:00
parent 66616ff23c
commit 28c9d9010d
2 changed files with 3 additions and 7 deletions

View File

@@ -24,7 +24,7 @@ pub fn set_system_tray(app: &AppHandle) -> tauri::Result<()> {
}
"quit" => {
let _res = app.save_window_state(StateFlags::all());
app.get_webview_window("pake").unwrap().close().unwrap();
std::process::exit(0);
}
_ => (),
})

View File

@@ -102,11 +102,9 @@ pub fn run_app() {
Ok(())
})
.on_window_event(|window, event| {
#[cfg(target_os = "macos")]
if let tauri::WindowEvent::CloseRequested { api, .. } = event {
let window = window.clone();
api.prevent_close();
#[cfg(target_os = "macos")]
{
tauri::async_runtime::spawn(async move {
if window.is_fullscreen().unwrap_or(false) {
@@ -118,9 +116,7 @@ pub fn run_app() {
window.hide().unwrap();
});
}
#[cfg(not(target_os = "macos"))]
std::process::exit(0);
api.prevent_close();
}
})
.run(tauri::generate_context!())