diff --git a/apps/desktop/electron/main.cjs b/apps/desktop/electron/main.cjs index 002280e888e..2a4b2fcb29c 100644 --- a/apps/desktop/electron/main.cjs +++ b/apps/desktop/electron/main.cjs @@ -3789,7 +3789,7 @@ function getWindowButtonPosition() { } function getNativeOverlayWidth() { - return computeNativeOverlayWidth({ isWindows: IS_WINDOWS, isWsl: IS_WSL }) + return computeNativeOverlayWidth({ isWindows: IS_WINDOWS, isWsl: IS_WSL, isMac: IS_MAC }) } function getWindowState() { diff --git a/apps/desktop/electron/titlebar-overlay-width.cjs b/apps/desktop/electron/titlebar-overlay-width.cjs index 27a62f1a9f3..7c1e4ca09f0 100644 --- a/apps/desktop/electron/titlebar-overlay-width.cjs +++ b/apps/desktop/electron/titlebar-overlay-width.cjs @@ -1,11 +1,24 @@ -// Pre-layout fallback for WCO right-edge reservation (--titlebar-tools-right). -// Live width comes from navigator.windowControlsOverlay in the renderer. +'use strict' const OVERLAY_FALLBACK_WIDTH = 144 -/** @param {{ isWindows?: boolean, isWsl?: boolean }} opts */ -function nativeOverlayWidth({ isWindows = false, isWsl = false } = {}) { - return isWindows || isWsl ? OVERLAY_FALLBACK_WIDTH : 0 +/** + * Static pre-layout reservation (px) for the right-side native window-controls + * overlay (min/max/close). Only a FALLBACK — once laid out the renderer reads + * the exact width from navigator.windowControlsOverlay + * (use-window-controls-overlay-width.ts) and uses this value only when the WCO + * API is unavailable. + * + * macOS uses traffic lights positioned via trafficLightPosition, not a WCO + * overlay, so it reserves nothing here. Every other desktop platform now paints + * the Electron overlay (Windows, WSLg, and plain Linux KDE/GNOME), so they all + * reserve the fallback width. + * + * @param {{ isWindows?: boolean, isWsl?: boolean, isMac?: boolean }} opts + */ +function nativeOverlayWidth({ isWindows = false, isWsl = false, isMac = false } = {}) { + if (isMac) return 0 + return OVERLAY_FALLBACK_WIDTH } module.exports = { OVERLAY_FALLBACK_WIDTH, nativeOverlayWidth } diff --git a/apps/desktop/electron/titlebar-overlay-width.test.cjs b/apps/desktop/electron/titlebar-overlay-width.test.cjs index a7b8b6f5215..b4d58c44b50 100644 --- a/apps/desktop/electron/titlebar-overlay-width.test.cjs +++ b/apps/desktop/electron/titlebar-overlay-width.test.cjs @@ -18,10 +18,17 @@ test('WSLg paints the same WCO, so it reserves the same fallback width', () => { assert.equal(nativeOverlayWidth({ isWsl: true }), OVERLAY_FALLBACK_WIDTH) }) -test('plain Linux and macOS reserve nothing', () => { - assert.equal(nativeOverlayWidth({ isWindows: false, isWsl: false }), 0) - assert.equal(nativeOverlayWidth(), 0) - assert.equal(nativeOverlayWidth({}), 0) +test('plain Linux paints the WCO too, so it reserves the fallback width', () => { + // Regression #53185: re-enabling the overlay on plain Linux (KDE/GNOME) + // without reserving its width left the native min/max/close buttons painting + // on top of the app's right-edge titlebar tools. + assert.equal(nativeOverlayWidth({ isWindows: false, isWsl: false }), OVERLAY_FALLBACK_WIDTH) + assert.equal(nativeOverlayWidth(), OVERLAY_FALLBACK_WIDTH) + assert.equal(nativeOverlayWidth({}), OVERLAY_FALLBACK_WIDTH) +}) + +test('macOS uses traffic lights, not a WCO overlay, so it reserves nothing', () => { + assert.equal(nativeOverlayWidth({ isMac: true }), 0) }) test('the fallback width is a sane positive pixel value', () => { diff --git a/scripts/release.py b/scripts/release.py index 78bb1d76c3c..1b1c88e38ac 100755 --- a/scripts/release.py +++ b/scripts/release.py @@ -70,6 +70,7 @@ AUTHOR_MAP = { "165020384+uperLu@users.noreply.github.com": "uperLu", # PR #50958 salvage (rename plugins/cron → plugins/cron_providers; #50872) "277269729+yusekiotacode@users.noreply.github.com": "yusekiotacode", # PR #48706 salvage (anthropic OAuth login token endpoint → platform.claude.com; #45250/#49821) "minz0721@outlook.com": "s010mn", # PR #29221 salvage (ollama-cloud reasoning_effort xhigh→max) + "128256017+chriswesley4@users.noreply.github.com": "chriswesley4", # PR #53185 salvage (re-enable titleBarOverlay on plain Linux; missing min/max/close regression) "jeevesassistant00@gmail.com": "jeeves-assistant", # PR #50771 (computer-use CuaDriver vision capture routing) "21178861+ScotterMonk@users.noreply.github.com": "ScotterMonk", # PR #50145 salvage (cron output truncation: adapter-aware chunking, #50126) "rrandqua@gmail.com": "TutkuEroglu", # PR #50481 salvage (AGENTS.md stale token-lock adapter path)