mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
fix: kernel-caused silent mode failure to start windows
This commit is contained in:
@@ -20,12 +20,16 @@ use tauri_plugin_window_state::{AppHandleExt, StateFlags};
|
||||
// 打开面板
|
||||
pub fn open_or_close_dashboard() {
|
||||
if let Some(window) = handle::Handle::global().get_window() {
|
||||
if let Ok(true) = window.is_focused() {
|
||||
// 如果窗口存在,则切换其显示状态
|
||||
if window.is_visible().unwrap_or(false) {
|
||||
let _ = window.hide();
|
||||
return;
|
||||
} else {
|
||||
let _ = window.show();
|
||||
let _ = window.set_focus();
|
||||
}
|
||||
} else {
|
||||
resolve::create_window();
|
||||
}
|
||||
resolve::create_window();
|
||||
}
|
||||
|
||||
// 重启clash
|
||||
|
||||
Reference in New Issue
Block a user