From e7d82e147863d90ae0f0744aa3b1ea2d8ecd79b6 Mon Sep 17 00:00:00 2001 From: Scott Lexium Date: Fri, 10 Apr 2026 12:09:37 +0100 Subject: [PATCH] fix: make HUD overlay and source selector follow across macOS Spaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both windows had alwaysOnTop but lacked setVisibleOnAllWorkspaces, so they stayed pinned to the Space they were first opened on. Users moving to a different virtual desktop would lose sight of the overlay. Calls setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true }) on macOS only — no-op on Windows/Linux so cross-platform behaviour is unchanged. --- electron/windows.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/electron/windows.ts b/electron/windows.ts index fb9a655..35a28b3 100644 --- a/electron/windows.ts +++ b/electron/windows.ts @@ -51,6 +51,12 @@ export function createHudOverlayWindow(): BrowserWindow { }, }); + // Follow the user across macOS Spaces (virtual desktops). + // Without this the HUD stays pinned to the Space it was first opened on. + if (process.platform === "darwin") { + win.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true }); + } + win.webContents.on("did-finish-load", () => { win?.webContents.send("main-process-message", new Date().toLocaleString()); }); @@ -142,6 +148,12 @@ export function createSourceSelectorWindow(): BrowserWindow { }, }); + // Follow the user across macOS Spaces so the selector appears on the + // active desktop regardless of where the HUD was originally opened. + if (process.platform === "darwin") { + win.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true }); + } + if (VITE_DEV_SERVER_URL) { win.loadURL(VITE_DEV_SERVER_URL + "?windowType=source-selector"); } else {