chore: remove useless hooks

the window is not closed, it is minimized, so the position still exists
This commit is contained in:
huzibaca 2024-10-30 10:06:54 +08:00
parent b809b9bb80
commit e40ea38112
2 changed files with 2 additions and 5 deletions

View File

@ -6,7 +6,7 @@ use crate::{
}; };
use anyhow::{anyhow, Result}; use anyhow::{anyhow, Result};
use once_cell::sync::OnceCell; use once_cell::sync::OnceCell;
use std::{env::temp_dir, path::PathBuf}; use std::path::PathBuf;
pub const RUNTIME_CONFIG: &str = "clash-verge.yaml"; pub const RUNTIME_CONFIG: &str = "clash-verge.yaml";
pub const CHECK_CONFIG: &str = "clash-verge-check.yaml"; pub const CHECK_CONFIG: &str = "clash-verge-check.yaml";

View File

@ -143,13 +143,10 @@ pub fn run() {
match event { match event {
tauri::WindowEvent::CloseRequested { api, .. } => { tauri::WindowEvent::CloseRequested { api, .. } => {
println!("closing window..."); println!("closing window...");
let _ = resolve::save_window_size_position(true);
api.prevent_close(); api.prevent_close();
let window = core::handle::Handle::global().get_window().unwrap(); let window = core::handle::Handle::global().get_window().unwrap();
log_err!(window.minimize()); log_err!(window.minimize());
let _ = resolve::save_window_size_position(true);
}
tauri::WindowEvent::Moved(_) | tauri::WindowEvent::Resized(_) => {
let _ = resolve::save_window_size_position(false);
} }
tauri::WindowEvent::Focused(true) => { tauri::WindowEvent::Focused(true) => {
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]