Skip to content
Merged
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: 6 additions & 2 deletions src/hooks/useScreenRecorder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,12 @@ describe("shouldUseNativeWindowsCaptureForSource", () => {
expect(shouldUseNativeWindowsCaptureForSource({ id: "screen:101:0" })).toBe(true);
});

it("routes window sources through browser capture", () => {
expect(shouldUseNativeWindowsCaptureForSource({ id: "window:123456:0" })).toBe(false);
it("keeps native Windows capture on window sources", () => {
expect(shouldUseNativeWindowsCaptureForSource({ id: "window:123456:0" })).toBe(true);
});

it("keeps browser capture for non-desktop sources", () => {
expect(shouldUseNativeWindowsCaptureForSource({ id: "browser-tab:abc" })).toBe(false);
});
});

Expand Down
5 changes: 4 additions & 1 deletion src/hooks/useScreenRecorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ export function resolveBrowserCaptureCursorPolicy({
export function shouldUseNativeWindowsCaptureForSource(
source: Pick<ProcessedDesktopSource, "id"> | null | undefined,
): boolean {
return source?.id?.startsWith("screen:") === true;
return (
source?.id?.startsWith("screen:") === true ||
source?.id?.startsWith("window:") === true
);
}

export function createProcessedMicrophoneConstraints(
Expand Down