mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 03:13:44 +08:00
rm: setup_window_state_monitor for temporary due to unkown window control behavior
This commit is contained in:
parent
fece31438a
commit
3fa130695c
@ -53,32 +53,35 @@ pub fn open_or_close_dashboard() {
|
|||||||
|
|
||||||
/// Setup window state monitor to save window position and size in real-time
|
/// Setup window state monitor to save window position and size in real-time
|
||||||
pub fn setup_window_state_monitor(app_handle: &tauri::AppHandle) {
|
pub fn setup_window_state_monitor(app_handle: &tauri::AppHandle) {
|
||||||
let window = app_handle.get_webview_window("main").unwrap();
|
// 暂时移除实时监控-保存窗口位置和大小,这个特性可能会导致窗口异常大小和位置,需要进一步优化
|
||||||
let app_handle_clone = app_handle.clone();
|
//
|
||||||
|
|
||||||
// 监听窗口移动事件
|
// let window = app_handle.get_webview_window("main").unwrap();
|
||||||
let app_handle_move = app_handle_clone.clone();
|
// let app_handle_clone = app_handle.clone();
|
||||||
window.on_window_event(move |event| {
|
|
||||||
match event {
|
// // 监听窗口移动事件
|
||||||
// 窗口移动时保存状态
|
// let app_handle_move = app_handle_clone.clone();
|
||||||
tauri::WindowEvent::Moved(_) => {
|
// window.on_window_event(move |event| {
|
||||||
let _ = app_handle_move.save_window_state(StateFlags::all());
|
// match event {
|
||||||
}
|
// // 窗口移动时保存状态
|
||||||
// 窗口调整大小时保存状态
|
// tauri::WindowEvent::Moved(_) => {
|
||||||
tauri::WindowEvent::Resized(_) => {
|
// let _ = app_handle_move.save_window_state(StateFlags::all());
|
||||||
let _ = app_handle_move.save_window_state(StateFlags::all());
|
// }
|
||||||
}
|
// // 窗口调整大小时保存状态
|
||||||
// 其他可能改变窗口状态的事件
|
// tauri::WindowEvent::Resized(_) => {
|
||||||
tauri::WindowEvent::ScaleFactorChanged { .. } => {
|
// let _ = app_handle_move.save_window_state(StateFlags::all());
|
||||||
let _ = app_handle_move.save_window_state(StateFlags::all());
|
// }
|
||||||
}
|
// // 其他可能改变窗口状态的事件
|
||||||
// 窗口关闭时保存
|
// tauri::WindowEvent::ScaleFactorChanged { .. } => {
|
||||||
tauri::WindowEvent::CloseRequested { .. } => {
|
// let _ = app_handle_move.save_window_state(StateFlags::all());
|
||||||
let _ = app_handle_move.save_window_state(StateFlags::all());
|
// }
|
||||||
}
|
// // 窗口关闭时保存
|
||||||
_ => {}
|
// tauri::WindowEvent::CloseRequested { .. } => {
|
||||||
}
|
// let _ = app_handle_move.save_window_state(StateFlags::all());
|
||||||
});
|
// }
|
||||||
|
// _ => {}
|
||||||
|
// }
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 优化的应用退出函数
|
/// 优化的应用退出函数
|
||||||
|
Loading…
x
Reference in New Issue
Block a user