mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-11-16 11:42:21 +08:00
fix: wrong window state save point
This commit is contained in:
parent
a5c4562f59
commit
ab7775e1ef
|
@ -139,7 +139,10 @@ pub fn run() {
|
|||
tauri::RunEvent::ExitRequested { api, code, .. } => {
|
||||
if code.is_none() {
|
||||
api.prevent_exit();
|
||||
return;
|
||||
}
|
||||
let app_hanele = core::handle::Handle::global().app_handle().unwrap();
|
||||
let _ = app_hanele.save_window_state(StateFlags::default());
|
||||
}
|
||||
tauri::RunEvent::WindowEvent { label, event, .. } => {
|
||||
if label == "main" {
|
||||
|
@ -147,10 +150,8 @@ pub fn run() {
|
|||
tauri::WindowEvent::CloseRequested { api, .. } => {
|
||||
println!("closing window...");
|
||||
api.prevent_close();
|
||||
let app_hanele = core::handle::Handle::global().app_handle().unwrap();
|
||||
let _ = app_hanele.save_window_state(StateFlags::default());
|
||||
let window = core::handle::Handle::global().get_window().unwrap();
|
||||
log_err!(window.hide());
|
||||
let _ = window.hide();
|
||||
}
|
||||
tauri::WindowEvent::Focused(true) => {
|
||||
#[cfg(target_os = "macos")]
|
||||
|
|
Loading…
Reference in New Issue
Block a user