Add a new Secondary Display Layout option on android that makes the secondary display honor swap button

This commit is contained in:
David Griswold 2025-09-17 14:12:10 +03:00
parent eb1197a65c
commit c4d2d44de3
5 changed files with 10 additions and 3 deletions

View file

@ -56,7 +56,9 @@ enum class SecondaryDisplayLayout(val int: Int) {
NONE(0),
TOP_SCREEN(1),
BOTTOM_SCREEN(2),
SIDE_BY_SIDE(3);
SIDE_BY_SIDE(3),
REVERSE_PRIMARY(4);
companion object {
fun from(int: Int): SecondaryDisplayLayout {

View file

@ -37,9 +37,11 @@
<string-array name="secondaryLayouts">
<item>@string/emulation_secondary_display_default</item>
<item>@string/emulation_secondary_display_reverse_primary</item>
<item>@string/emulation_top_screen</item>
<item>@string/emulation_bottom_screen</item>
<item>@string/emulation_screen_layout_sidebyside</item>
</string-array>
<integer-array name="portraitLayoutValues">
@ -50,6 +52,7 @@
<integer-array name="secondaryLayoutValues">
<item>0</item>
<item>4</item>
<item>1</item>
<item>2</item>
<item>3</item>

View file

@ -449,6 +449,7 @@
<string name="emulation_screen_layout_original">Original</string>
<string name="emulation_portrait_layout_top_full">Default</string>
<string name="emulation_secondary_display_default">System Default (mirror)</string>
<string name="emulation_secondary_display_reverse_primary">Opposite of Primary Display</string>
<string name="emulation_screen_layout_custom">Custom Layout</string>
<string name="bg_color">Background Color</string>
<string name="bg_color_description">The color which appears behind the screens during emulation, represented as an RGB value.</string>

View file

@ -54,7 +54,7 @@ enum class PortraitLayoutOption : u32 {
PortraitOriginal
};
enum class SecondaryDisplayLayout : u32 { None, TopScreenOnly, BottomScreenOnly, SideBySide };
enum class SecondaryDisplayLayout : u32 { None, TopScreenOnly, BottomScreenOnly, SideBySide, ReversePrimary };
/** Defines where the small screen will appear relative to the large screen
* when in Large Screen mode
*/

View file

@ -342,7 +342,8 @@ FramebufferLayout AndroidSecondaryLayout(u32 width, u32 height) {
const Settings::SecondaryDisplayLayout layout =
Settings::values.secondary_display_layout.GetValue();
switch (layout) {
case Settings::SecondaryDisplayLayout::ReversePrimary:
return SingleFrameLayout(width,height,! Settings::values.swap_screen,Settings::values.upright_screen.GetValue());
case Settings::SecondaryDisplayLayout::BottomScreenOnly:
return SingleFrameLayout(width, height, true, Settings::values.upright_screen.GetValue());
case Settings::SecondaryDisplayLayout::SideBySide: