mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-25 23:35:43 +00:00
Revert "fix(linux): expand HUD fallback for menus"
This reverts commit e2802bffad.
This commit is contained in:
@@ -3,8 +3,6 @@ import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
getHudOverlayWindowBounds,
|
||||
resizeHudOverlayFallbackBounds,
|
||||
shouldExpandHudOverlayFallback,
|
||||
shouldResizeHudOverlayFallback,
|
||||
} from "./hudOverlayBounds";
|
||||
|
||||
describe("getHudOverlayWindowBounds", () => {
|
||||
@@ -145,53 +143,3 @@ describe("resizeHudOverlayFallbackBounds", () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("shouldResizeHudOverlayFallback", () => {
|
||||
it("allows non-passthrough HUD windows to expand for menus when idle", () => {
|
||||
expect(shouldResizeHudOverlayFallback(false, false)).toBe(true);
|
||||
});
|
||||
|
||||
it("does not resize full passthrough HUD windows", () => {
|
||||
expect(shouldResizeHudOverlayFallback(true, false)).toBe(false);
|
||||
});
|
||||
|
||||
it("keeps the recording HUD compact in non-passthrough mode", () => {
|
||||
expect(shouldResizeHudOverlayFallback(false, true)).toBe(false);
|
||||
});
|
||||
|
||||
it("keeps the fallback stable while source selection is active", () => {
|
||||
expect(shouldResizeHudOverlayFallback(false, false, true)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("shouldExpandHudOverlayFallback", () => {
|
||||
it("expands while recording only when the floating webcam preview is visible", () => {
|
||||
expect(
|
||||
shouldExpandHudOverlayFallback({
|
||||
fallbackExpanded: false,
|
||||
recordingActive: true,
|
||||
webcamPreviewVisible: true,
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("keeps the compact recording fallback when there is no webcam preview", () => {
|
||||
expect(
|
||||
shouldExpandHudOverlayFallback({
|
||||
fallbackExpanded: false,
|
||||
recordingActive: true,
|
||||
webcamPreviewVisible: false,
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("preserves manual fallback expansion outside recording", () => {
|
||||
expect(
|
||||
shouldExpandHudOverlayFallback({
|
||||
fallbackExpanded: true,
|
||||
recordingActive: false,
|
||||
webcamPreviewVisible: false,
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -37,27 +37,6 @@ export function getHudOverlayWindowBounds(
|
||||
height,
|
||||
};
|
||||
}
|
||||
|
||||
export function shouldResizeHudOverlayFallback(
|
||||
mousePassthroughSupported: boolean,
|
||||
recordingActive: boolean,
|
||||
interactionLocked = false,
|
||||
): boolean {
|
||||
return !mousePassthroughSupported && !recordingActive && !interactionLocked;
|
||||
}
|
||||
|
||||
export function shouldExpandHudOverlayFallback({
|
||||
fallbackExpanded,
|
||||
recordingActive,
|
||||
webcamPreviewVisible,
|
||||
}: {
|
||||
fallbackExpanded: boolean;
|
||||
recordingActive: boolean;
|
||||
webcamPreviewVisible: boolean;
|
||||
}): boolean {
|
||||
return fallbackExpanded || (recordingActive && webcamPreviewVisible);
|
||||
}
|
||||
|
||||
export function resizeHudOverlayFallbackBounds(
|
||||
workArea: HudOverlayWorkArea,
|
||||
currentBounds: HudOverlayWorkArea,
|
||||
|
||||
+4
-27
@@ -5,12 +5,7 @@ import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { app, BrowserWindow, ipcMain } from "electron";
|
||||
import { USER_DATA_PATH } from "./appPaths";
|
||||
import {
|
||||
getHudOverlayWindowBounds,
|
||||
resizeHudOverlayFallbackBounds,
|
||||
shouldExpandHudOverlayFallback,
|
||||
shouldResizeHudOverlayFallback,
|
||||
} from "./hudOverlayBounds";
|
||||
import { getHudOverlayWindowBounds, resizeHudOverlayFallbackBounds } from "./hudOverlayBounds";
|
||||
import { getPackagedRendererBaseUrl } from "./rendererServer";
|
||||
|
||||
const electronWindowsDir = path.dirname(fileURLToPath(import.meta.url));
|
||||
@@ -196,15 +191,10 @@ function getHudOverlayDisplay() {
|
||||
|
||||
function getHudOverlayBounds() {
|
||||
const { workArea } = getHudOverlayDisplay();
|
||||
const fallbackExpanded = shouldExpandHudOverlayFallback({
|
||||
fallbackExpanded: hudOverlayFallbackExpanded,
|
||||
recordingActive: hudOverlayRecordingActive,
|
||||
webcamPreviewVisible: hudOverlayWebcamPreviewVisible,
|
||||
});
|
||||
return getHudOverlayWindowBounds(
|
||||
workArea,
|
||||
isHudOverlayMousePassthroughSupported() && !hudOverlayRecordingActive,
|
||||
fallbackExpanded,
|
||||
hudOverlayFallbackExpanded,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -311,21 +301,8 @@ function setHudOverlayMousePassthrough(ignore: boolean) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (hudOverlaySourceSelectionActive) {
|
||||
hudOverlayFallbackExpanded = false;
|
||||
hudOverlayWindow.setIgnoreMouseEvents(false);
|
||||
return;
|
||||
}
|
||||
|
||||
const mousePassthroughSupported = isHudOverlayMousePassthroughSupported();
|
||||
if (!mousePassthroughSupported) {
|
||||
if (
|
||||
shouldResizeHudOverlayFallback(
|
||||
mousePassthroughSupported,
|
||||
hudOverlayRecordingActive,
|
||||
hudOverlaySourceSelectionActive,
|
||||
)
|
||||
) {
|
||||
if (!isHudOverlayMousePassthroughSupported()) {
|
||||
if (process.platform !== "linux") {
|
||||
setHudOverlayFallbackExpanded(!ignore);
|
||||
}
|
||||
hudOverlayWindow.setIgnoreMouseEvents(false);
|
||||
|
||||
Reference in New Issue
Block a user