diff --git a/electron/ipc/recording/ffmpeg.ts b/electron/ipc/recording/ffmpeg.ts index 2d486d16c..ab5d436c1 100644 --- a/electron/ipc/recording/ffmpeg.ts +++ b/electron/ipc/recording/ffmpeg.ts @@ -16,6 +16,14 @@ export function getDisplayBoundsForSource(source: SelectedSource) { ).bounds; } +export function getDisplayWorkAreaForSource(source: SelectedSource) { + const allDisplays = getScreen().getAllDisplays(); + const primaryDisplay = getScreen().getPrimaryDisplay(); + const { displayId } = resolveWindowsCaptureDisplay(source, allDisplays, primaryDisplay); + const matched = allDisplays.find((d) => d.id === displayId) ?? primaryDisplay; + return matched.workArea; +} + export async function buildFfmpegCaptureArgs(source: SelectedSource, outputPath: string) { const commonOutputArgs = [ "-an", diff --git a/electron/ipc/register/sources.ts b/electron/ipc/register/sources.ts index 433989128..a5e6d601e 100644 --- a/electron/ipc/register/sources.ts +++ b/electron/ipc/register/sources.ts @@ -5,7 +5,7 @@ import { ALLOW_RECORDLY_WINDOW_CAPTURE } from "../constants"; import { selectedSource, setSelectedSource } from "../state"; import type { SelectedSource } from "../types"; import { getScreen, parseWindowId } from "../utils"; -import { getDisplayBoundsForSource } from "../recording/ffmpeg"; +import { getDisplayBoundsForSource, getDisplayWorkAreaForSource } from "../recording/ffmpeg"; import { getNativeMacWindowSources, resolveMacWindowBounds, @@ -337,7 +337,10 @@ export function registerSourceHandlers({ let bounds: { x: number; y: number; width: number; height: number } | null = null; if (source.id?.startsWith("screen:")) { - bounds = getDisplayBoundsForSource(source); + bounds = + process.platform === "darwin" + ? getDisplayWorkAreaForSource(source) + : getDisplayBoundsForSource(source); } else if (isWindow) { if (process.platform === "darwin") { bounds = await resolveMacWindowBounds(source); @@ -363,7 +366,12 @@ export function registerSourceHandlers({ const resolvedBounds = bounds; // ── 3. Show traveling wave highlight ── - const pad = 6; + // On macOS, screen highlights use workArea and no outward padding — + // macOS clamps window positions below the menu bar so outward + // padding only works on the left/top while right/bottom run off-screen. + const isScreen = source.id?.startsWith("screen:"); + const isMacScreen = isScreen && process.platform === "darwin"; + const pad = isMacScreen ? 0 : 6; const highlightWin = new BrowserWindow({ x: resolvedBounds.x - pad, y: resolvedBounds.y - pad, @@ -381,13 +389,18 @@ export function registerSourceHandlers({ highlightWin.setIgnoreMouseEvents(true); + const borderRadius = isMacScreen ? 0 : 10; + const glowInset = isMacScreen ? 0 : -4; + const glowRadius = isMacScreen ? 0 : 14; + const glowPad = isMacScreen ? 3 : 6; + const html = `