perf & fix: optimize window state initialization & add missing permissions

This commit is contained in:
wonfen
2025-05-16 09:50:53 +08:00
parent 53a46d0dc6
commit ddd85d4d87
3 changed files with 19 additions and 14 deletions

View File

@@ -11,7 +11,6 @@ use anyhow::{bail, Result};
use once_cell::sync::OnceCell;
use parking_lot::{Mutex, RwLock};
use percent_encoding::percent_decode_str;
use serde::{Deserialize, Serialize};
use serde_yaml::Mapping;
use std::{
net::TcpListener,
@@ -65,13 +64,6 @@ impl Default for UiReadyState {
// 获取UI就绪状态细节
static UI_READY_STATE: OnceCell<Arc<UiReadyState>> = OnceCell::new();
// 定义窗口状态结构体
#[derive(Debug, Serialize, Deserialize)]
struct WindowState {
width: Option<u32>,
height: Option<u32>,
}
fn get_window_creating_lock() -> &'static Mutex<(bool, Instant)> {
WINDOW_CREATING.get_or_init(|| Mutex::new((false, Instant::now())))
}