feat: the unfolded controls can stay while a controller is connected (#996)

On foldables the unfolded-screen controls panel hides whenever a
controller is connected (#829). Phones held in a telescopic controller
still want its trackpads and back grips, so a new setting under
"Controls on the unfolded screen" keeps the panel with a controller.
It is off by default and appears in the launcher settings and the
in-session menu while unfolded controls are on.

The visibility decision moves into SessionDisplay.unfoldedControlsWanted
with unit tests.

Closes #861

Co-authored-by: ovurrsl <ovurrsl@users.noreply.github.com>
Co-authored-by: xXJsonDeruloXx <danielhimebauch@gmail.com>
This commit is contained in:
authored and GitHub committed 2026-10-22 10:43:41 -04:00
1 parent 8ed98b570b
commit 3c622a9323
11 files changed
+96 -6

No files matched your search

@@ -88,6 +88,7 @@ class ModeSettings(
val mangoapp: Boolean = true,
val steamController: String? = null,
val unfoldedControls: Boolean? = null,
val unfoldedControlsWithController: Boolean = false,
val runSteamAtStartup: Boolean = false,
val bootMovie: String? = null,
val bootMovieSound: Boolean = true,
@@ -140,6 +141,7 @@ class ModeSettingsActions(
val onReturnAfterGame: (Boolean) -> Unit = {},
val onSteamController: (String) -> Unit = {},
val onUnfoldedControls: (Boolean) -> Unit = {},
val onUnfoldedControlsWithController: (Boolean) -> Unit = {},
val onRunSteamAtStartup: (Boolean) -> Unit = {},
val onBootMovie: (String) -> Unit = {},
val onBootMovieSound: (Boolean) -> Unit = {},
@@ -290,6 +292,11 @@ fun ModeSheetRows(s: ModeSettings, a: ModeSettingsActions, tab: String, extras:
stringResource(R.string.unfolded_controls_hint),
s.unfoldedControls, onChange = a.onUnfoldedControls,
)
if (steam && s.unfoldedControls == true) ToggleRow(
host, "unfolded-controls-with-controller", stringResource(R.string.unfolded_controls_with_controller),
stringResource(R.string.unfolded_controls_with_controller_hint),
s.unfoldedControlsWithController, onChange = a.onUnfoldedControlsWithController,
)
if (steam) ChoiceRow(
host, "back-actions", stringResource(R.string.mode_back), stringResource(SessionPrefs.backActionsOrder(s.backActionsInverted)),
listOf(
@@ -278,6 +278,8 @@ class DrawerActions(
val onPipAutoEnter: (Boolean) -> Unit = {},
val unfoldedControls: Boolean? = null,
val onUnfoldedControls: (Boolean) -> Unit = {},
val unfoldedControlsWithController: Boolean = false,
val onUnfoldedControlsWithController: (Boolean) -> Unit = {},
val onShareLogs: () -> Unit,
val onStop: () -> Unit,
val onStopFrom: ((androidx.compose.ui.geometry.Rect?) -> Unit)? = null,
@@ -575,6 +577,11 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
if (a.steam && a.unfoldedControls != null) ToggleRow(host, "unfolded-controls", stringResource(R.string.unfolded_controls),
stringResource(R.string.unfolded_controls_hint), a.unfoldedControls,
chipModifier = focus.track(page, "unfolded-controls"), onChange = a.onUnfoldedControls)
if (a.steam && a.unfoldedControls == true) ToggleRow(host, "unfolded-controls-with-controller",
stringResource(R.string.unfolded_controls_with_controller),
stringResource(R.string.unfolded_controls_with_controller_hint), a.unfoldedControlsWithController,
chipModifier = focus.track(page, "unfolded-controls-with-controller"),
onChange = a.onUnfoldedControlsWithController)
}
SettingsGroup(stringResource(R.string.drawer_latency)) {
ToggleRow(host, "low-latency-controller", stringResource(R.string.drawer_low_latency_controller),