Description
The custom titlebar trick repositions the macOS traffic lights by re-framing AppKit's private views: window_set_titlebar_zoom grows the titlebar container to 44px × zoom and re-centers the close/minimize/zoom buttons at x = 16 + index·spacing inside it. AppKit doesn't know about these frames — on window resize it runs its own titlebar layout and resets the container and buttons to their stock geometry, so the traffic lights visibly jump back to the default top-left position.
Nothing re-applies the custom frames on resize. The command only runs at three triggers: app mount (App.tsx:57), zoom change (applyAppZoom), and fullscreen exit (AppShell.tsx:43). After a plain resize the lights stay in the wrong (stock) position until one of those happens.
Expected behavior
Traffic lights stay vertically centered in the custom titlebar at the custom inset through and after window resizes.
Likely fix shape: re-apply the frames when the window resizes — either an AppKit-side observer (NSWindow windowDidResize/live-resize notifications calling the same re-frame routine, which also fixes mid-resize jumping) or, cheaper but flicker-prone, a frontend onResized listener re-invoking window_set_titlebar_zoom. The AppKit-side observer is the correct fix since it catches live-resize layout passes.
Steps to reproduce
- Launch the app (traffic lights sit centered in the 44px titlebar).
- Drag any window edge/corner to resize.
- Traffic lights jump to the macOS default position and stay there.
- Change app zoom (⌘+/-) or exit fullscreen — they snap back to the custom position.
Relevant code
src-tauri/src/commands/window.rs:148-208 — window_set_titlebar_zoom: titlebar container re-frame + per-button setFrameOrigin; TRAFFIC_LIGHT_X/TITLEBAR_HEIGHT constants.
src/lib/appZoom.ts:19-34 — syncTitlebarZoom, the only invoke path.
src/App.tsx:57 (mount), src/components/AppShell.tsx:43 (fullscreen exit) — the current re-apply triggers; no resize trigger exists.
Environment
- OS: macOS
- Version: 0.4.12
Description
The custom titlebar trick repositions the macOS traffic lights by re-framing AppKit's private views:
window_set_titlebar_zoomgrows the titlebar container to44px × zoomand re-centers the close/minimize/zoom buttons atx = 16 + index·spacinginside it. AppKit doesn't know about these frames — on window resize it runs its own titlebar layout and resets the container and buttons to their stock geometry, so the traffic lights visibly jump back to the default top-left position.Nothing re-applies the custom frames on resize. The command only runs at three triggers: app mount (
App.tsx:57), zoom change (applyAppZoom), and fullscreen exit (AppShell.tsx:43). After a plain resize the lights stay in the wrong (stock) position until one of those happens.Expected behavior
Traffic lights stay vertically centered in the custom titlebar at the custom inset through and after window resizes.
Likely fix shape: re-apply the frames when the window resizes — either an AppKit-side observer (
NSWindowwindowDidResize/live-resize notifications calling the same re-frame routine, which also fixes mid-resize jumping) or, cheaper but flicker-prone, a frontendonResizedlistener re-invokingwindow_set_titlebar_zoom. The AppKit-side observer is the correct fix since it catches live-resize layout passes.Steps to reproduce
Relevant code
src-tauri/src/commands/window.rs:148-208—window_set_titlebar_zoom: titlebar container re-frame + per-buttonsetFrameOrigin;TRAFFIC_LIGHT_X/TITLEBAR_HEIGHTconstants.src/lib/appZoom.ts:19-34—syncTitlebarZoom, the only invoke path.src/App.tsx:57(mount),src/components/AppShell.tsx:43(fullscreen exit) — the current re-apply triggers; no resize trigger exists.Environment