From 4eccedcd7852285a67bfc5298d51b21206788672 Mon Sep 17 00:00:00 2001 From: huzibaca Date: Wed, 25 Sep 2024 13:54:05 +0800 Subject: [PATCH] fix: the save_indow_size_position method has been triggered twice, at the same time 1. remove windowEvent::destoryed hook --- src-tauri/src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 65715f27..85d39d97 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -142,10 +142,8 @@ pub fn run() { tauri::RunEvent::WindowEvent { label, event, .. } => { if label == "main" { match event { - tauri::WindowEvent::Destroyed => { - let _ = resolve::save_window_size_position(true); - } tauri::WindowEvent::CloseRequested { .. } => { + println!("closing window..."); let _ = resolve::save_window_size_position(true); } tauri::WindowEvent::Moved(_) | tauri::WindowEvent::Resized(_) => {