Revert "fix(linux): expand HUD fallback for menus"

This reverts commit e2802bffad.
This commit is contained in:
webadderall
2026-06-05 10:32:11 +10:00
parent 79f1356652
commit d2796fbf84
3 changed files with 4 additions and 100 deletions
-52
View File
@@ -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);
});
});
-21
View File
@@ -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
View File
@@ -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);