From 6545231d83a569ec2caafd3540701ccbe3accf5d Mon Sep 17 00:00:00 2001 From: H-Chris233 Date: Sun, 3 May 2026 12:22:14 +0800 Subject: [PATCH] Restore mac traffic lights without enabling native chrome on Linux/Windows Keep custom chrome on non-mac platforms while restoring native traffic lights on macOS. Also remove the extra outer mac shell radius/border to avoid double-rounded corners. Constraint: macOS must show native traffic lights for issue #183 Constraint: Windows/Linux should keep custom titlebar behavior Rejected: set decorations=true in tauri.conf globally | enables native chrome on Linux Confidence: high Scope-risk: narrow Directive: Platform-specific window decoration behavior should be controlled at runtime, not by global config Tested: npm run build (openless-all/app) Not-tested: manual visual verification on real macOS/Linux/Windows runtimes --- openless-all/app/src-tauri/src/lib.rs | 3 +++ openless-all/app/src/components/WindowChrome.tsx | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/openless-all/app/src-tauri/src/lib.rs b/openless-all/app/src-tauri/src/lib.rs index 03c69213..13cd0b36 100644 --- a/openless-all/app/src-tauri/src/lib.rs +++ b/openless-all/app/src-tauri/src/lib.rs @@ -93,6 +93,9 @@ pub fn run() { use window_vibrancy::{ apply_vibrancy, NSVisualEffectMaterial, NSVisualEffectState, }; + if let Err(e) = main.set_decorations(true) { + log::warn!("[main] enable native decorations failed: {e}"); + } if let Err(e) = apply_vibrancy( &main, NSVisualEffectMaterial::HudWindow, diff --git a/openless-all/app/src/components/WindowChrome.tsx b/openless-all/app/src/components/WindowChrome.tsx index c460b260..437a39c6 100644 --- a/openless-all/app/src/components/WindowChrome.tsx +++ b/openless-all/app/src/components/WindowChrome.tsx @@ -47,7 +47,7 @@ export function WindowChrome({ children, height = 800, }: WindowChromeProps) { - const shellRadius = os === 'mac' ? 20 : os === 'win' ? WIN_WINDOW_RADIUS : 14; + const shellRadius = os === 'mac' ? 0 : os === 'win' ? WIN_WINDOW_RADIUS : 14; const consoleRadius = os === 'mac' ? 20 : os === 'win' ? WIN_CONSOLE_RADIUS : 14; return ( @@ -66,7 +66,11 @@ export function WindowChrome({ overflow: 'hidden', display: 'flex', flexDirection: 'column', - border: os === 'win' ? '1px solid rgba(255,255,255,0.18)' : '0.5px solid rgba(0,0,0,.10)', + border: os === 'mac' + ? 'none' + : os === 'win' + ? '1px solid rgba(255,255,255,0.18)' + : '0.5px solid rgba(0,0,0,.10)', background: ` radial-gradient(120% 80% at 0% 0%, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 60%), radial-gradient(100% 70% at 100% 100%, rgba(37,99,235,0.07) 0%, rgba(37,99,235,0) 55%),