authorgravatar for 97427849+flamboh@users.noreply.github.comoliver <97427849+flamboh@users.noreply.github.com> 2026-10-11 16:19:04-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-11 20:19:04-03:00
log662148dd296984d11b40863ce6f90ead9c26396e
treefe28a26d21a24b1dd413055a2df69ccfa82cf863
parentc1d528a342ef14fa960a8cc6283d6324b4488f5c
signature Signed by PGP key B5690EEEBB952194

fix(desktop): tooltips no longer open under the macOS traffic lights (#17726)


1 files changed, 7 insertions(+), 1 deletions(-)

apps/web/src/lib/windowControlsOverlay.ts+7-1
......@@ -1,10 +1,15 @@
11import { useSyncExternalStore } from "react";
22
3import { isWindowsPlatform } from "./utils";
3import { isElectron } from "~/env";
4
5import { isMacPlatform, isWindowsPlatform } from "./utils";
46
57const WCO_CLASS_NAME = "wco";
68const ELECTRON_CLASS_NAME = "electron";
79const ELECTRON_WINDOWS_CLASS_NAME = "electron-windows";
10// The workspace topbar the desktop app centers the traffic lights in. macOS has
11// no overlay API to measure, and the lights stay inside it at any zoom level.
12const MACOS_TITLEBAR_HEIGHT = 52;
813
914interface WindowControlsOverlayLike {
1015 readonly visible: boolean;
......@@ -53,6 +58,7 @@ function subscribeTitlebarArea(listener: () => void): () => void {
5358}
5459
5560function getNativeTitlebarHeight(): number {
61 if (isElectron && isMacPlatform(navigator.platform)) return MACOS_TITLEBAR_HEIGHT;
5662 const overlay = getWindowControlsOverlay();
5763 return overlay?.visible ? overlay.getTitlebarAreaRect().bottom : 0;
5864}