From 662148dd296984d11b40863ce6f90ead9c26396e Mon Sep 17 00:00:00 2001 From: oliver <97427849+flamboh@users.noreply.github.com> Date: Sun, 11 Oct 2026 16:19:04 -0700 Subject: [PATCH] fix(desktop): tooltips no longer open under the macOS traffic lights (#17726) --- apps/web/src/lib/windowControlsOverlay.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/web/src/lib/windowControlsOverlay.ts b/apps/web/src/lib/windowControlsOverlay.ts index 6508ebc4a0edb9e125fa40949287ad07732fb989..24f179f6cb966d8a59aa00a72ab5e32ba9a94688 100644 --- a/apps/web/src/lib/windowControlsOverlay.ts +++ b/apps/web/src/lib/windowControlsOverlay.ts @@ -1,10 +1,15 @@ import { useSyncExternalStore } from "react"; -import { isWindowsPlatform } from "./utils"; +import { isElectron } from "~/env"; + +import { isMacPlatform, isWindowsPlatform } from "./utils"; const WCO_CLASS_NAME = "wco"; const ELECTRON_CLASS_NAME = "electron"; const ELECTRON_WINDOWS_CLASS_NAME = "electron-windows"; +// The workspace topbar the desktop app centers the traffic lights in. macOS has +// no overlay API to measure, and the lights stay inside it at any zoom level. +const MACOS_TITLEBAR_HEIGHT = 52; interface WindowControlsOverlayLike { readonly visible: boolean; @@ -53,6 +58,7 @@ function subscribeTitlebarArea(listener: () => void): () => void { } function getNativeTitlebarHeight(): number { + if (isElectron && isMacPlatform(navigator.platform)) return MACOS_TITLEBAR_HEIGHT; const overlay = getWindowControlsOverlay(); return overlay?.visible ? overlay.getTitlebarAreaRect().bottom : 0; } -- 2.54.0