mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-25 07:16:02 +00:00
Keep the recording webcam movable and visible
This commit is contained in:
+10
-1
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user