Force the controls editor to landscape - #693
Merged
Merged
Conversation
The PC controls editor was unlocked to fullUser along with the rest of the UI in WinNative-Emu#687, but its layout was never adapted for portrait. The toolbar is a wrap_content row of six tool buttons that overflows a narrow screen, and element positions are laid out on a grid derived from view width, so a portrait viewport scatters the overlay into unusable vertical gaps. Editing a profile in portrait was not possible. Pin the activity back to sensorLandscape so the overlay is authored in the orientation the game runs in. The manifest alone is not enough to keep it that way. Every activity deriving from the FixedFontScale bases calls applyOrientationLock in onCreate, which sets FULL_USER whenever the force-landscape preference is off, overriding the manifest at runtime. Add a LandscapeOnlyActivity marker that the shared helper honours ahead of the preference, so the editor stays landscape even if its manifest entry is loosened again. XServerDisplayActivity picks its own orientation from the container screen size, and the same helper could stomp a portrait game when the preference is toggled while that session is alive. Mark it SelfManagedOrientationActivity so the shared lock leaves it alone.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The PC controls editor was unlocked to fullUser along with the rest of the UI in #687, but its layout was never adapted for portrait. The toolbar is a wrap_content row of six tool buttons that overflows a narrow screen, and element positions are laid out on a grid derived from view width, so a portrait viewport scatters the overlay into unusable vertical gaps. Editing a profile in portrait was not possible.
Pin the activity back to sensorLandscape so the overlay is authored in the orientation the game runs in.
The manifest alone is not enough to keep it that way. Every activity deriving from the FixedFontScale bases calls applyOrientationLock in onCreate, which sets FULL_USER whenever the force-landscape preference is off, overriding the manifest at runtime. Add a LandscapeOnlyActivity marker that the shared helper honours ahead of the preference, so the editor stays landscape even if its manifest entry is loosened again.
XServerDisplayActivity picks its own orientation from the container screen size, and the same helper could stomp a portrait game when the preference is toggled while that session is alive. Mark it SelfManagedOrientationActivity so the shared lock leaves it alone.