File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
src/vs/platform/windows/electron-main Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -420,12 +420,11 @@ export abstract class BaseWindow extends Disposable implements IBaseWindow {
420420
421421 // macOS: update window controls via setWindowButtonPosition()
422422 else if ( isMacintosh && options . height !== undefined ) {
423- // The traffic lights have a height of 12px. There's an invisible margin
424- // of 2px at the top and bottom, and 1px on the left and right. Therefore,
425- // the height for centering is 12px + 2 * 2px = 16px. When the position
426- // is set, the horizontal margin is offset to ensure the distance between
427- // the traffic lights and the window frame is equal in both directions.
428- const offset = Math . floor ( ( options . height - 16 ) / 2 ) ;
423+ // When the position is set, the horizontal margin is offset to ensure
424+ // the distance between the traffic lights and the window frame is equal
425+ // in both directions.
426+ const buttonHeight = isTahoeOrNewer ( release ( ) ) ? 14 : 16 ;
427+ const offset = Math . floor ( ( options . height - buttonHeight ) / 2 ) ;
429428 if ( ! offset ) {
430429 win . setWindowButtonPosition ( null ) ;
431430 } else {
You can’t perform that action at this time.
0 commit comments