From d9ceb50aceef42de1cbf0c9cab3376603b526ef8 Mon Sep 17 00:00:00 2001 From: flamboh Date: Sat, 10 Oct 2026 00:39:39 +0000 Subject: [PATCH] fix(desktop): tooltips no longer open under the macOS traffic lights --- 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 6508ebc4a0ed..24f179f6cb96 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; }