You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make macOS traffic lights follow the theme's title bar height
#39117
A theme can change the height of the macOS title bar through --workspace-topbar-height. The native traffic lights do not move with it. When a theme sets the bar to 44px, the bar's content centres at 22px, but the traffic lights stay centred at 26px. They then sit about 4pt below the logo and breadcrumb.
The cause is in apps/desktop (main process). The traffic-light position comes from a hard-coded constant:
The web app's CSS height and the main process's button position therefore come from two separate values. A theme can change only the first.
Proposal
Make the traffic lights follow the height that the renderer actually uses:
The renderer reads the computed --workspace-topbar-height after a theme is applied. It does this again when the theme or zoom changes.
It sends the value to the main process over the existing desktop bridge.
The main process calls BrowserWindow.setWindowButtonPosition({ x: 16, y: Math.round((height * zoomFactor - 14) / 2) }).
Taking the zoom factor into account would also keep the buttons aligned when the user zooms (related: #12036).
Precedent
The Codex desktop app does this. It computes the position from its bar height and the zoom factor: { x: 16, y: Math.round((44 * zoom - 14) / 2) }. Its buttons stay centred when the text size changes.
Why it matters
A theme can already restyle the title bar fully, but any height other than 52px leaves the traffic lights off-centre. With this change, compact title bars (for example 44px) become possible from a theme.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Problem
A theme can change the height of the macOS title bar through
--workspace-topbar-height. The native traffic lights do not move with it. When a theme sets the bar to 44px, the bar's content centres at 22px, but the traffic lights stay centred at 26px. They then sit about 4pt below the logo and breadcrumb.The cause is in
apps/desktop(main process). The traffic-light position comes from a hard-coded constant:The web app's CSS height and the main process's button position therefore come from two separate values. A theme can change only the first.
Proposal
Make the traffic lights follow the height that the renderer actually uses:
--workspace-topbar-heightafter a theme is applied. It does this again when the theme or zoom changes.BrowserWindow.setWindowButtonPosition({ x: 16, y: Math.round((height * zoomFactor - 14) / 2) }).Taking the zoom factor into account would also keep the buttons aligned when the user zooms (related: #12036).
Precedent
The Codex desktop app does this. It computes the position from its bar height and the zoom factor:
{ x: 16, y: Math.round((44 * zoom - 14) / 2) }. Its buttons stay centred when the text size changes.Why it matters
A theme can already restyle the title bar fully, but any height other than 52px leaves the traffic lights off-centre. With this change, compact title bars (for example 44px) become possible from a theme.
All reactions