Merge pull request #661 from webadderallorg/fix/windows-wgc-window-capture

fix(windows): use WGC for window capture
This commit is contained in:
webadderall
2026-06-06 21:24:20 +10:00
committed by GitHub
2 changed files with 10 additions and 3 deletions
+6 -2
View File
@@ -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);
});
});
+4 -1
View File
@@ -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(