Skip to content

fix(windows): use WGC for window capture#661

Merged
webadderall merged 1 commit into
mainfrom
fix/windows-wgc-window-capture
Jun 6, 2026
Merged

fix(windows): use WGC for window capture#661
webadderall merged 1 commit into
mainfrom
fix/windows-wgc-window-capture

Conversation

@webadderall
Copy link
Copy Markdown
Collaborator

@webadderall webadderall commented Jun 6, 2026

Summary

  • route Windows window sources through the native WGC path instead of browser/Electron capture
  • keep the Windows native capture gate aligned with the existing window-target resolver
  • add a regression test so Windows desktop sources use native capture for both screens and windows

Validation

  • node /Users/work/Desktop/recordly/node_modules/vitest/vitest.mjs --root /Users/work/Desktop/recordly-wgc-fix --config /Users/work/Desktop/recordly-wgc-fix/vitest.config.ts run /Users/work/Desktop/recordly-wgc-fix/src/hooks/useScreenRecorder.test.ts /Users/work/Desktop/recordly-wgc-fix/electron/ipc/windowsCaptureSelection.test.ts
  • /Users/work/Desktop/recordly/node_modules/.bin/tsc -p tsconfig.json --noEmit

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced window capture in screen recording to use native system capabilities.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 6, 2026

Need the big picture first? Review this PR in Change Stack to see what changed before going file by file.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5b97a30b-3f17-4f0c-8461-2d63b4c52325

📥 Commits

Reviewing files that changed from the base of the PR and between bfe0a2f and bf99108.

📒 Files selected for processing (2)
  • src/hooks/useScreenRecorder.test.ts
  • src/hooks/useScreenRecorder.ts

📝 Walkthrough

Walkthrough

This PR expands the native Windows capture eligibility logic to include window sources alongside screen sources. The shouldUseNativeWindowsCaptureForSource predicate now matches both screen:* and window:* source IDs, with test coverage updated to validate the new behavior and ensure non-desktop sources remain unaffected.

Changes

Window Source Native Capture

Layer / File(s) Summary
Source matching expansion
src/hooks/useScreenRecorder.ts
shouldUseNativeWindowsCaptureForSource predicate expanded to return true for both screen:* and window:* source ID prefixes.
Window source native capture tests
src/hooks/useScreenRecorder.test.ts
Test cases updated to expect native capture for window sources and to assert browser-tab sources do not use native capture.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

  • #423: Addresses the same window: source ID flow by expanding native Windows capture eligibility, complementing the issue's Windows-side plumbing that forwards windowId for native captures.

Possibly related PRs

  • webadderallorg/Recordly#485: Aligns with Windows recording logic that parses windowId from source.id to select between windowHandle and displayId for native captures.
  • webadderallorg/Recordly#583: Modifies the same Windows-native capture path selection in useScreenRecorder.ts, affecting the fallback flow when native capture fails.
  • webadderallorg/Recordly#596: Modifies the same decision boundary for whether window:* sources route through native WGC or browser/electron capture.

Suggested labels

Checked

Poem

🐰 A window opens wide today,
No longer screened from native's way,
The capture path now flows more true,
With tests to prove what sources do! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description provides a clear summary and validation details, but is missing several required template sections including Motivation, Type of Change, Related Issue(s), Screenshots/Video, Testing Guide, and a self-review checklist. Add the missing template sections: explain the motivation/problem being solved, explicitly mark the Type of Change (Bug Fix), link any related issues, include testing instructions, and complete the self-review checklist.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(windows): use WGC for window capture' is specific and directly describes the main change in the PR—routing Windows window sources through native WGC instead of browser capture.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/windows-wgc-window-capture

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@webadderall webadderall merged commit 7ca2de2 into main Jun 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant