You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(windows): handle rotated displays with software capture - #6097
Rotated displays can remain black with software encoding because the RAM capture path compares the rotated desktop dimensions against Desktop Duplication's unrotated texture, repeatedly reinitializing capture.
Stage and validate the texture using its unrotated dimensions, then rotate the pixels into desktop orientation before composing the cursor. Allocate RAM images using the desktop width and copy rows independently of GPU padding; Windows Graphics Capture uses the same row-copy helper with identity rotation because its frames already have desktop orientation. Existing mode-change recovery keeps the client-requested stream resolution.
Added six regression tests using real D3D11 WARP textures and controlled Desktop Duplication events. They cover all DXGI orientations, both supported BGRA formats, independent row padding, cursor placement, image reuse, unexpected dimensions, and access-loss recovery.
The landscape capture regression fails with the original size checks and passes with this fix.
Windows x64/UCRT64 test build passed; all 46 selected capture and video tests passed:
gcovr reports 27/27 executable lines covered in the new rotation helper.
uv sync --locked, uv run --locked lb-update-clang-format, and git diff --check passed.
Installer packaging was disabled for the local test build. The full test suite, physical ARM64 hardware, and rotation during a live Moonlight stream were not tested.
Type of Change
feat: New feature (non-breaking change which adds functionality)
fix: Bug fix (non-breaking change which fixes an issue)
docs: Documentation only changes
style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
refactor: Code change that neither fixes a bug nor adds a feature
perf: Code change that improves performance
test: Adding missing tests or correcting existing tests
build: Changes that affect the build system or external dependencies
ci: Changes to CI configuration files and scripts
chore: Other changes that don't modify src or test files
revert: Reverts a previous commit
BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)
Checklist
Code follows the style guidelines of this project
Code has been self-reviewed
Code has been commented, particularly in hard-to-understand areas
Code docstring/documentation-blocks for new or existing methods/components have been added or updated
Tests have been added or updated for new or modified functionality, including regression tests for bug fixes
❌ Patch coverage is 94.87179% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.80%. Comparing base (657f9b6) to head (61caea5).
✅ All tests successful. No failed tests found.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Rotated displays can remain black with software encoding because the RAM capture path compares the rotated desktop dimensions against Desktop Duplication's unrotated texture, repeatedly reinitializing capture.
Stage and validate the texture using its unrotated dimensions, then rotate the pixels into desktop orientation before composing the cursor. Allocate RAM images using the desktop width and copy rows independently of GPU padding; Windows Graphics Capture uses the same row-copy helper with identity rotation because its frames already have desktop orientation. Existing mode-change recovery keeps the client-requested stream resolution.
Screenshot
Issues Fixed or Closed
Roadmap Issues
Testing
uv sync --locked,uv run --locked lb-update-clang-format, andgit diff --checkpassed.Type of Change
Checklist
AI Usage
See our AI usage policy.
Codex assisted with the investigation, implementation, regression tests, and PR preparation.