Keep the recording webcam movable and visible

This commit is contained in:
young
2026-09-01 18:49:41 +10:00
parent e8e2928520
commit dd7af60407
2 changed files with 15 additions and 4 deletions
+10 -1
View File
@@ -184,7 +184,7 @@ function getHudOverlayBounds() {
});
return getHudOverlayWindowBounds(
workArea,
isHudOverlayMousePassthroughSupported() && !hudOverlayRecordingActive,
isHudOverlayMousePassthroughSupported(),
fallbackExpanded,
);
}
@@ -457,6 +457,15 @@ export function createHudOverlayWindow(): BrowserWindow {
backgroundThrottling: false,
},
});
// Keep the recording controls and webcam above normal and full-screen apps.
// Transparent regions remain click-through via setIgnoreMouseEvents().
win.setAlwaysOnTop(true, "screen-saver");
if (process.platform === "darwin") {
win.setVisibleOnAllWorkspaces(true, {
visibleOnFullScreen: true,
skipTransformProcessType: true,
});
}
const showHudWindow = () => {
if (hasShownHudWindow || win.isDestroyed()) {
@@ -1,4 +1,4 @@
import { useCallback, useEffect, useRef, useState, type PointerEvent } from "react";
import { type PointerEvent, useCallback, useEffect, useRef, useState } from "react";
import { canShowFloatingWebcamPreview } from "../floatingWebcamPreview";
const WEBCAM_PREVIEW_DRAG_THRESHOLD = 6;
@@ -118,8 +118,10 @@ export function useWebcamPreviewOverlay({
const latestDeltaX = pointer.clientX - latestDragState.startX;
const latestDeltaY = pointer.clientY - latestDragState.startY;
const viewportWidth = Math.max(window.innerWidth, window.screen?.width ?? 0);
const viewportHeight = Math.max(window.innerHeight, window.screen?.height ?? 0);
// Pointer coordinates and getBoundingClientRect() are relative to the HUD
// viewport. `screen.width` can use a different display/DPI coordinate space.
const viewportWidth = window.innerWidth;
const viewportHeight = window.innerHeight;
const unclampedLeft = latestDragState.initialLeft + latestDeltaX;
const unclampedTop = latestDragState.initialTop + latestDeltaY;
const clampedLeft = Math.min(