From 3cf51b381437775ccc7257cd070c93829b58d106 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Mon, 28 Sep 2026 12:19:01 -0400 Subject: [PATCH] Deck mode: enable Steam's performance overlay controls The Quick Access menu's performance overlay toggle and level slider stayed greyed out: the client exposes SteamClient.System.Perf only with -steamos3, which SteamOS and Armada pass alongside -steamdeck. Deck mode now launches the client with both. The session already puts package/beta back to the forced branch before every start, which keeps -steamos3's own branch switch from turning into an update loop. The Deck mode switch moves from the Performance page to the Steam page's Client settings, next to the client branch it selects by default. --- .../com/droiddeck/launcher/MainActivity.kt | 9 ++++++-- .../launcher/session/SessionPrefs.kt | 2 +- .../launcher/ui/ModeSettingsDialog.kt | 8 +++++++ .../launcher/ui/PerformanceDialog.kt | 7 ------- .../overlay/usr/local/bin/bannerlator-session | 21 +++++++++---------- 5 files changed, 26 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/com/droiddeck/launcher/MainActivity.kt b/app/src/main/java/com/droiddeck/launcher/MainActivity.kt index eaec48d8f1..d8b9f1c1fb 100644 --- a/app/src/main/java/com/droiddeck/launcher/MainActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/MainActivity.kt @@ -782,6 +782,7 @@ class MainActivity : ComponentActivity() { storageOptions = storageOptions, fexPreset = if (mode == SessionService.MODE_STEAM) fexPreset else null, steamChannel = if (mode == SessionService.MODE_STEAM) steamChannel else null, + steamDeckMode = mode == SessionService.MODE_STEAM && steamDeckMode, runSteamAtStartup = mode == SessionService.MODE_STEAM && runSteamAtStartup, addedGamesDirs = if (mode == SessionService.MODE_STEAM) addedGamesDirs else null, addedGames = if (mode == SessionService.MODE_STEAM) addedGames else emptyList(), @@ -833,6 +834,11 @@ class MainActivity : ComponentActivity() { }, onFexPreset = { id -> SessionPrefs.setFexPreset(this, id); fexPreset = id }, onSteamChannel = { id -> SessionPrefs.setSteamChannel(this, id); steamChannel = id }, + onSteamDeckMode = { on -> + SessionPrefs.setSteamDeckMode(this, on) + steamDeckMode = on + steamChannel = SessionPrefs.steamChannel(this) + }, onRunSteamAtStartup = { on -> SessionPrefs.setRunSteamAtStartup(this, on) runSteamAtStartup = on @@ -863,14 +869,13 @@ class MainActivity : ComponentActivity() { PerformancePage( cores = CpuCores.all.map { c -> CoreRow(c, "cpu$c" + (CpuCores.maxGhz(c)?.let { String.format(java.util.Locale.US, " ยท %.1f GHz", it) } ?: "")) }, clientOverride = clientOverride, clientCores = clientCores, gameCores = gameCores, - tuSysmem = tuSysmem, zinkLazy = zinkLazy, glThread = glThread, noGlError = noGlError, steamDeckMode = steamDeckMode, noXalia = noXalia, + tuSysmem = tuSysmem, zinkLazy = zinkLazy, glThread = glThread, noGlError = noGlError, noXalia = noXalia, prootNoSeccomp = prootNoSeccomp, phantomWarning = phantomWarning, onClientOverride = { on -> SessionPrefs.setClientCpusOverride(this, on); clientOverride = on }, onTuSysmem = { on -> SessionPrefs.setTuSysmem(this, on); tuSysmem = on }, onZinkLazy = { on -> SessionPrefs.setZinkLazy(this, on); zinkLazy = on }, onGlThread = { on -> SessionPrefs.setGlThread(this, on); glThread = on }, onNoGlError = { on -> SessionPrefs.setNoGlError(this, on); noGlError = on }, - onSteamDeckMode = { on -> SessionPrefs.setSteamDeckMode(this, on); steamDeckMode = on }, onNoXalia = { on -> SessionPrefs.setNoXalia(this, on); noXalia = on }, onProotNoSeccomp = { on -> SessionPrefs.setProotNoSeccomp(this, on); prootNoSeccomp = on }, onClientCore = { core, on -> diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt index 13e680c886..1f3f1c69ea 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt @@ -232,7 +232,7 @@ object SessionPrefs { fun noGlError(context: Context): Boolean = prefs(context).getBoolean("noGlError", true) fun setNoGlError(context: Context, on: Boolean) { prefs(context).edit().putBoolean("noGlError", on).apply() } - /** `steam -steamdeck -steamos3`: the client as SteamOS runs it. Expects Deck hardware; untested. */ + /** Runs the SteamOS gamepad client with its Quick Access performance controls. */ fun steamDeckMode(context: Context): Boolean = prefs(context).getBoolean("steamDeckMode", false) fun setSteamDeckMode(context: Context, on: Boolean) { prefs(context).edit().putBoolean("steamDeckMode", on).apply() } diff --git a/app/src/main/java/com/droiddeck/launcher/ui/ModeSettingsDialog.kt b/app/src/main/java/com/droiddeck/launcher/ui/ModeSettingsDialog.kt index 2bdea340f7..5f13007b2c 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/ModeSettingsDialog.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/ModeSettingsDialog.kt @@ -66,6 +66,8 @@ class ModeSettings( val forceFullscreen: Boolean? = null, /** Steam only: the client branch forced on the command line. */ val steamChannel: String? = null, + /** Steam only: enable the SteamOS client interface and its performance controls. */ + val steamDeckMode: Boolean = false, /** Steam only: start a Steam session when DroidDeck opens. */ val runSteamAtStartup: Boolean = false, /** Steam only: the user's chosen Games folders; null outside Steam. */ @@ -121,6 +123,7 @@ class ModeSettingsActions( val onFexPreset: (String) -> Unit = {}, val onForceFullscreen: (Boolean) -> Unit = {}, val onSteamChannel: (String) -> Unit = {}, + val onSteamDeckMode: (Boolean) -> Unit = {}, val onRunSteamAtStartup: (Boolean) -> Unit = {}, val onPickAddedGamesDir: () -> Unit = {}, val onForgetAddedGamesDir: (path: String) -> Unit = {}, @@ -336,6 +339,11 @@ fun ModeSettingsPage(s: ModeSettings, a: ModeSettingsActions) { } } if (steam && s.steamChannel != null) SettingsGroup("Client") { + ToggleRow( + host, "steamdeck", "Steam Deck mode", + "Enables Steam's Deck interface and Quick Access performance overlay controls. Applies next session.", + s.steamDeckMode, onChange = a.onSteamDeckMode, + ) ChoiceRow( host, "channel", "Client branch", "The Steam client build the session forces. Applies at the next session start; the client may update itself once.", listOf("publicbeta" to "Public beta", "steamdeck_publicbeta" to "Steam Deck public beta"), s.steamChannel, diff --git a/app/src/main/java/com/droiddeck/launcher/ui/PerformanceDialog.kt b/app/src/main/java/com/droiddeck/launcher/ui/PerformanceDialog.kt index 7fac4329ba..8c093a12f3 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/PerformanceDialog.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/PerformanceDialog.kt @@ -29,7 +29,6 @@ fun PerformancePage( zinkLazy: Boolean, glThread: Boolean, noGlError: Boolean, - steamDeckMode: Boolean, noXalia: Boolean, prootNoSeccomp: Boolean, phantomWarning: String?, @@ -38,7 +37,6 @@ fun PerformancePage( onZinkLazy: (Boolean) -> Unit, onGlThread: (Boolean) -> Unit, onNoGlError: (Boolean) -> Unit, - onSteamDeckMode: (Boolean) -> Unit, onNoXalia: (Boolean) -> Unit, onProotNoSeccomp: (Boolean) -> Unit, onClientCore: (Int, Boolean) -> Unit, @@ -87,11 +85,6 @@ fun PerformancePage( "Disables per-call GL validation.", noGlError, onChange = onNoGlError, ) - ToggleRow( - host, "deck", "Steam Deck mode", - "Runs the client with -droiddeck. SteamOS helpers and battery info are provided.", - steamDeckMode, onChange = onSteamDeckMode, - ) } SettingsGroup("Session fixes") { ToggleRow( diff --git a/tools/linuxfs/overlay/usr/local/bin/bannerlator-session b/tools/linuxfs/overlay/usr/local/bin/bannerlator-session index c0adc95e78..b039c8b59b 100755 --- a/tools/linuxfs/overlay/usr/local/bin/bannerlator-session +++ b/tools/linuxfs/overlay/usr/local/bin/bannerlator-session @@ -501,20 +501,19 @@ BUSCONF # desktop's launchers ask for; gamescope shows one window at a time and the game takes over. _bl_ui=(-gamepadui) [ "${BL_STEAM_UI:-}" = desktop ] && _bl_ui=() - # Deck mode (BL_STEAMDECK=1, the Performance page): -steamdeck is the flag that puts the Quick - # Access Menu, the performance overlay and the Deck settings pages on screen. Only -steamdeck, - # never -steamos3: that one makes the client manage itself as SteamOS does - it calls - # steamos-select-branch and opts the install into the steamdeck_stable client branch, writes - # that to package/beta, and from then on the branch on disk loses to the -clientbeta below on - # every launch; the updater finds "installed version 0", marks an update pending and exits 42 - # to apply it, which never happens, so the client restarts for ever - under a running game, - # taking Steam Input with it each time. (Bannerlator 38996ea1, on device.) The SteamOS helpers - # the client calls in this mode are staged as no-op stubs under /usr/bin. + # Deck mode (BL_STEAMDECK=1, the Steam page's Client settings): -steamdeck is the flag that puts + # the Quick Access Menu and the Deck settings pages on screen; the QAM's performance overlay + # controls stay greyed out without -steamos3, as SteamOS and Armada launch it. -steamos3 makes + # the client manage itself as SteamOS does - it calls steamos-select-branch and writes + # steamdeck_stable to package/beta, and a branch on disk that loses to the -clientbeta below + # is an update that never installs: exit 42, a restart, for ever (Bannerlator 38996ea1). The + # loop below puts package/beta back before every start. The SteamOS helpers the client calls + # in this mode are staged as no-op stubs under /usr/bin. if [ "${BL_STEAMDECK:-0}" = 1 ] && [ "${BL_STEAM_UI:-}" != desktop ]; then - _bl_ui+=(-steamdeck) + _bl_ui+=(-steamdeck -steamos3) # The QAM's Scaling Filter lists NVIDIA Image Scaling only when told gamescope has it (it does). export STEAM_GAMESCOPE_NIS_SUPPORTED=1 - echo "== steam: Deck mode on (-steamdeck)" + echo "== steam: Deck mode on (-steamdeck -steamos3)" fi # What a killed session leaves behind. Android ends sessions without warning (backgrounding, the # low-memory killer), and the client then finds .crash - opening its update UI on the spinner -