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
This commit is contained in:
H-Chris233 committed 2026-05-03 12:22:14 +08:00
1 parent a2a5605239
commit 6545231d83
2 files changed
+9 -2

No files matched your search

+3
View File
@@ -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,
@@ -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%),