diff --git a/Changelog.md b/Changelog.md index 524197c2a..a85832b6c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -21,6 +21,6 @@ - 优化切换节点时的延迟 - 优化托盘退出快捷键显示 - 优化首次启动节点信息刷新 -- 默认使用内置窗口控件 +- Linux 默认使用内置窗口控件 diff --git a/src-tauri/src/utils/resolve/window.rs b/src-tauri/src/utils/resolve/window.rs index 35c26486b..5e009bd46 100644 --- a/src-tauri/src/utils/resolve/window.rs +++ b/src-tauri/src/utils/resolve/window.rs @@ -21,6 +21,11 @@ const DEFAULT_HEIGHT: f64 = 700.0; const MINIMAL_WIDTH: f64 = 520.0; const MINIMAL_HEIGHT: f64 = 520.0; +#[cfg(target_os = "linux")] +const DEFAULT_DECORATIONS: bool = false; +#[cfg(not(target_os = "linux"))] +const DEFAULT_DECORATIONS: bool = true; + /// 构建新的 WebView 窗口 pub async fn build_new_window() -> Result { let app_handle = handle::Handle::app_handle(); @@ -61,8 +66,7 @@ pub async fn build_new_window() -> Result { ) .title("Clash Verge") .center() - // Default to custom titlebar; users can switch to system titlebar in settings. - .decorations(false) + .decorations(DEFAULT_DECORATIONS) .fullscreen(false) .inner_size(DEFAULT_WIDTH, DEFAULT_HEIGHT) .min_inner_size(MINIMAL_WIDTH, MINIMAL_HEIGHT)