mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
fix: performance issues caused by closing windows on mac
This commit is contained in:
@@ -141,8 +141,11 @@ pub fn run() {
|
||||
tauri::RunEvent::WindowEvent { label, event, .. } => {
|
||||
if label == "main" {
|
||||
match event {
|
||||
tauri::WindowEvent::CloseRequested { .. } => {
|
||||
tauri::WindowEvent::CloseRequested { api, .. } => {
|
||||
println!("closing window...");
|
||||
api.prevent_close();
|
||||
let window = core::handle::Handle::global().get_window().unwrap();
|
||||
log_err!(window.minimize());
|
||||
let _ = resolve::save_window_size_position(true);
|
||||
}
|
||||
tauri::WindowEvent::Moved(_) | tauri::WindowEvent::Resized(_) => {
|
||||
|
||||
Reference in New Issue
Block a user