Skip to content

Add manual rotation config option for portrait panels where KMS reports native resolution.#4877

Open
sam1am wants to merge 2 commits intoLizardByte:masterfrom
sam1am:master
Open

Add manual rotation config option for portrait panels where KMS reports native resolution.#4877
sam1am wants to merge 2 commits intoLizardByte:masterfrom
sam1am:master

Conversation

@sam1am
Copy link

@sam1am sam1am commented Mar 20, 2026

Description

Adds a manual_rotation config option (0, 90, 180, 270 degrees) for portrait panels used in landscape orientation (e.g. Steam Deck, GPD, etc.) where KMS reports raw panel resolution instead of logical orientation.

Screenshot

clipboard_2026-03-19_21-51

Issues Fixed or Closed

Roadmap Issues

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
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

sam1am added 2 commits March 19, 2026 18:44
Adds a manual_rotation config option (0, 90, 180, 270 degrees) for
portrait panels used in landscape orientation (e.g. Steam Deck) where
KMS reports raw panel resolution instead of logical orientation.
- Locale JSON keys sorted alphabetically
- Web UShader duplication documented
- Created tests/unit/test_config.cpp with parameterized tests covering:
  - All valid rotation values (0, 90, 180, 270)
  - Invalid values that should normalize to 0 (45, 360, -90, 1, non-numeric "abc")
  - Default value verification
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
4 New issues
4 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copy link
Member

@ReenigneArcher ReenigneArcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we auto detect the rotation? I ask because if the user has multiple monitors and switches between which ones are streamed, this solution is likely to be painful.

@Dregu
Copy link
Contributor

Dregu commented Mar 21, 2026

Oh hey this shader was one of the things I wanted to investigate for #4788 since the protocol can send a wonky framebuffer with transform as metadata. So yeah this setting could use some more options, i.e. even 0deg should be explicitly set, not the default, and the default should be auto, i.e. let the platform decide.

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.

Portrait screens in landscape orientation are seen as portrait with KMS

3 participants