Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions electron/cameraPreview.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,15 @@ describe("floating camera preview lifecycle", () => {
expect(overlay.webContents.send).not.toHaveBeenCalled();
});

it("creates a hidden exclusion window even when the camera starts off", () => {
it("opens no window at launch while the camera is off (#1639)", () => {
const { preview, sender, owner, overlay, create } = setup();
preview.configure(sender, false, true);
overlay.emit("ready-to-show");
expect(create).toHaveBeenCalledOnce();
expect(overlay.hide).toHaveBeenCalledOnce();
expect(overlay.showInactive).not.toHaveBeenCalled();
expect(create).not.toHaveBeenCalled();
preview.frame(sender, jpeg);
expect(overlay.webContents.send).not.toHaveBeenCalled();
preview.configure(sender, true, true);
expect(create).toHaveBeenCalledOnce();
overlay.emit("ready-to-show");
expect(overlay.showInactive).toHaveBeenCalledOnce();
owner.emit("destroyed");
expect(overlay.destroy).toHaveBeenCalledOnce();
Expand Down
5 changes: 5 additions & 0 deletions electron/cameraPreview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ export class CameraPreviewController {
}

configure(owner: WebContents, enabled: boolean, visible: boolean): void {
// The HUD configures on mount, camera on or off. With the camera off, do not open a
// second content-protected transparent window beside the HUD at launch: v2.3.0 did,
// and on macOS 15 the HUD then never painted (#1639). The macOS capture paths still
// reserve the window before they read exclusion IDs (ensureMacCameraPreviewWindow).
if (!enabled && !this.window) return;
const previewWindow = this.ensure(owner);
if (!previewWindow) return;
this.visible = enabled && visible;
Expand Down
Loading