mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 05:33:45 +08:00
fix: windows cannot save window state
This commit is contained in:
parent
18b0c3f7aa
commit
95b7641f9c
@ -124,6 +124,7 @@ pub fn quit(code: Option<i32>) {
|
|||||||
resolve::restore_public_dns().await;
|
resolve::restore_public_dns().await;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
log_err!(app_handle.save_window_state(StateFlags::default()));
|
||||||
app_handle.exit(code.unwrap_or(0));
|
app_handle.exit(code.unwrap_or(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ use crate::core::hotkey;
|
|||||||
use crate::utils::{resolve, resolve::resolve_scheme, server};
|
use crate::utils::{resolve, resolve::resolve_scheme, server};
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
use tauri::Listener;
|
use tauri::Listener;
|
||||||
use tauri_plugin_window_state::{AppHandleExt, StateFlags};
|
|
||||||
|
|
||||||
pub fn run() {
|
pub fn run() {
|
||||||
// 单例检测
|
// 单例检测
|
||||||
@ -147,8 +146,6 @@ pub fn run() {
|
|||||||
api.prevent_exit();
|
api.prevent_exit();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let app_hanele = core::handle::Handle::global().app_handle().unwrap();
|
|
||||||
let _ = app_hanele.save_window_state(StateFlags::default());
|
|
||||||
}
|
}
|
||||||
tauri::RunEvent::WindowEvent { label, event, .. } => {
|
tauri::RunEvent::WindowEvent { label, event, .. } => {
|
||||||
if label == "main" {
|
if label == "main" {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user