mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-22 06:15:58 +00:00
feat(session): split the display resolution into landscape and portrait (#2990)
## Summary Splits the session resolution setting into two: **Landscape resolution** and **Portrait resolution**. Each has the same options as the old Resolution row, plus a Follow option so one orientation can mirror the other. ## Why A single resolution has to serve both orientations. Presets and Match screen flip automatically in portrait, but a custom size is used exactly as typed, so a landscape size in a portrait session is wrong. Users who play in both orientations couldn't pick a good size for each. ## Behavior - The Display tab shows **Landscape resolution** and, underneath it, **Portrait resolution**. Both offer the full existing list: presets, Match screen, Follow screen, scaled follow options and Custom. - Each row has an extra option at the top. **Follow portrait** (on the landscape row) and **Follow landscape** (on the portrait row) use the other orientation's choice, so someone can set one resolution and let the other mirror it. The label shows the size it resolves to. - A session picks the landscape or portrait choice from its orientation. This uses the same orientation check as the output size, so the unfolded-controls layout still counts as landscape. - Custom WxH sizes are flipped to match the target orientation when followed, e.g. portrait following 1280x720 uses 720x1280. - If both rows would follow each other, the other row is set to the concrete size it currently resolves to, so there is never a loop and nothing visibly changes. - The glasses output keeps using the landscape resolution. - Applies to the Steam and Desktop Display tabs, which share the same row. ## Compatibility - The existing saved choice (`displayResolution.<mode>`) is now the landscape resolution, so existing users keep their setting. - The portrait choice is stored as `displayResolution.portrait.<mode>` and defaults to Follow landscape, so portrait sessions behave as before until it is changed. The settings reset covers it through the existing `displayResolution.` prefix. - One visible difference: a typed landscape custom size, used as typed in portrait before, now flips to portrait while portrait follows landscape. ## Known limitation "Follow screen" is still decided once when the session starts, not on every rotation. Re-evaluating it on rotation could make the window orientation flip repeatedly when no orientation is pinned. ## Changes - `SessionDisplay`: `LINK_LANDSCAPE` / `LINK_PORTRAIT`, `isLink`, `orientCustom`, `effectiveChoice` - `SessionPrefs`: `resolutionStored` (raw value per orientation), `resolutionChoice(..., portrait)`, `setResolutionChoice(..., portrait)` with the loop guard, `resolutionChosen(..., portrait)` - `SessionActivity`: `portraitOutput()` drives the output size, follow-screen choice and follow scale; the Match-screen default for programs that draw at the panel size checks the matching orientation - `ResolutionRow`, `ModeSettingsDialog`, `FrontEndActivity`: two rows, the Follow option, state and actions - `DeviceReport`: logs landscape and portrait separately - Strings: `display_resolution_landscape`, `display_resolution_portrait`, `display_follow_landscape`, `display_follow_portrait` in all 33 locales; the unused `display_resolution` is removed - Tests: `PortraitResolutionTest` ## Testing - Unit tests added for the preference logic, follow resolution, loop guard and reset.
This commit is contained in:
42 files changed
+388
-103
No files matched your search
@@ -1028,7 +1028,7 @@
|
||||
<string name="setup_launcher_orientation_auto">Follow device rotation</string>
|
||||
<string name="setup_orientation_portrait">Portrait</string>
|
||||
<string name="setup_session_orientation">Session orientation</string>
|
||||
<string name="setup_session_orientation_hint">Applies to Steam, games, desktop, and the controller editor. Resolution presets rotate with the session; custom width and height stay as entered.</string>
|
||||
<string name="setup_session_orientation_hint">Applies to Steam, games, desktop, and the controller editor. Resolution presets rotate with the session; when one orientation follows the other, custom width and height flip to match.</string>
|
||||
<string name="setup_orientation_auto">Automatic landscape</string>
|
||||
<string name="setup_orientation_landscape">Landscape</string>
|
||||
<string name="setup_orientation_reverse">Reverse landscape</string>
|
||||
@@ -2723,7 +2723,10 @@
|
||||
<string name="phantom_warning">%1$s. %2$s\n\n%3$s</string>
|
||||
<string name="display_session">Session display</string>
|
||||
<string name="display_zero_copy">Zero-copy presentation</string>
|
||||
<string name="display_resolution">Resolution</string>
|
||||
<string name="display_resolution_landscape">Landscape resolution</string>
|
||||
<string name="display_resolution_portrait">Portrait resolution</string>
|
||||
<string name="display_follow_landscape">Follow landscape (%1$d×%2$d)</string>
|
||||
<string name="display_follow_portrait">Follow portrait (%1$d×%2$d)</string>
|
||||
<string name="display_game_fit">16:9 game fit</string>
|
||||
<string name="display_game_fit_hint">How 16:9 games fit this display. Next session.</string>
|
||||
<string name="display_game_fit_unavailable">Choose Match screen or a custom size that isn\'t 16:9.</string>
|
||||
|
||||
Reference in new issue
Block a user