diff --git a/electron/cameraPreview.test.ts b/electron/cameraPreview.test.ts index 1c30bb5b0..f56262234 100644 --- a/electron/cameraPreview.test.ts +++ b/electron/cameraPreview.test.ts @@ -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(); diff --git a/electron/cameraPreview.ts b/electron/cameraPreview.ts index 663fc4914..32b914b71 100644 --- a/electron/cameraPreview.ts +++ b/electron/cameraPreview.ts @@ -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;