fix: default on linux (#6420)

This commit is contained in:
Slinetrac 2026-03-04 19:53:25 +08:00 committed by GitHub
parent 05cdebd7ec
commit de2b09785d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -21,6 +21,6 @@
- 优化切换节点时的延迟
- 优化托盘退出快捷键显示
- 优化首次启动节点信息刷新
- 默认使用内置窗口控件
- Linux 默认使用内置窗口控件
</details>

View File

@ -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<WebviewWindow, String> {
let app_handle = handle::Handle::app_handle();
@ -61,8 +66,7 @@ pub async fn build_new_window() -> Result<WebviewWindow, String> {
)
.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)