From 3dd14dd62587e3c8022b6d8af3e14bac36017024 Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Sat, 10 Oct 2026 22:15:42 -0400 Subject: [PATCH] refactor: Steam always runs in Deck mode on the Deck beta branch (#546) --- .../main/java/com/droiddeck/launcher/App.kt | 2 - .../com/droiddeck/launcher/MainActivity.kt | 13 ---- .../droiddeck/launcher/core/DeviceReport.kt | 1 - .../launcher/session/SessionPrefs.kt | 38 +--------- .../launcher/session/SessionService.kt | 5 +- .../launcher/ui/ModeSettingsDialog.kt | 23 +------ app/src/main/res/values-es/strings.xml | 8 --- app/src/main/res/values-fr/strings.xml | 8 --- app/src/main/res/values-ja/strings.xml | 8 --- app/src/main/res/values-ko/strings.xml | 8 --- app/src/main/res/values-ru/strings.xml | 8 --- app/src/main/res/values-zh-rCN/strings.xml | 8 --- app/src/main/res/values-zh-rHK/strings.xml | 8 --- app/src/main/res/values-zh-rTW/strings.xml | 8 --- app/src/main/res/values/strings.xml | 8 --- .../launcher/session/SteamChannelTest.kt | 42 ----------- .../overlay/usr/local/bin/droiddeck-session | 19 ++--- .../usr/local/bin/droiddeck-steam-install | 8 +-- tools/tests/test_steam_install.py | 69 +++++++------------ 19 files changed, 45 insertions(+), 247 deletions(-) delete mode 100644 app/src/test/java/com/droiddeck/launcher/session/SteamChannelTest.kt diff --git a/app/src/main/java/com/droiddeck/launcher/App.kt b/app/src/main/java/com/droiddeck/launcher/App.kt index d1287beddb..e12aefb38d 100644 --- a/app/src/main/java/com/droiddeck/launcher/App.kt +++ b/app/src/main/java/com/droiddeck/launcher/App.kt @@ -22,8 +22,6 @@ class App : Application() { override fun onCreate() { super.onCreate() CrashHandler.install(this) - // Before anything else touches the session prefs, so the first session already runs in Deck mode. - com.droiddeck.launcher.session.SessionPrefs.settleDeckModeDefault(this) com.droiddeck.launcher.session.SessionPrefs.settleGpuDriverMode(this) com.droiddeck.launcher.update.AppUpdates.init(this) GpuClockPin.clearLeftover(this) diff --git a/app/src/main/java/com/droiddeck/launcher/MainActivity.kt b/app/src/main/java/com/droiddeck/launcher/MainActivity.kt index d1f17bf1f0..1db0681286 100644 --- a/app/src/main/java/com/droiddeck/launcher/MainActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/MainActivity.kt @@ -121,7 +121,6 @@ class MainActivity : ComponentActivity() { private var showNonAdreno by mutableStateOf(null) private var glThread by mutableStateOf(true) private var noGlError by mutableStateOf(true) - private var steamDeckMode by mutableStateOf(false) private var steamRepairQueued by mutableStateOf(false) private var mangoapp by mutableStateOf(true) private var steamController by mutableStateOf(SessionPrefs.CONTROLLER_DECK) @@ -344,7 +343,6 @@ class MainActivity : ComponentActivity() { private var resolution by mutableStateOf(com.droiddeck.launcher.session.SessionDisplay.DEFAULT_RESOLUTION) private var fexPreset by mutableStateOf("") private var forceSsbs by mutableStateOf(false) - private var steamChannel by mutableStateOf("steamdeck_publicbeta") private var runSteamAtStartup by mutableStateOf(false) private var theme by mutableStateOf("graphite") private var appScale by mutableStateOf(com.droiddeck.launcher.core.AppUiPrefs.DEFAULT_SCALE) @@ -1301,8 +1299,6 @@ class MainActivity : ComponentActivity() { fexPreset = if (mode == SessionService.MODE_STEAM) fexPreset else null, forceSsbs = forceSsbs, syncBackend = if (mode == SessionService.MODE_STEAM) SessionPrefs.syncBackendOf(fastSync, fsyncFirst, syncFallback) else null, - steamChannel = if (mode == SessionService.MODE_STEAM) steamChannel else null, - steamDeckMode = mode == SessionService.MODE_STEAM && steamDeckMode, steamRepairQueued = steamRepairQueued, mangoapp = mangoapp, steamController = if (mode == SessionService.MODE_STEAM) steamController else null, @@ -1380,13 +1376,7 @@ class MainActivity : ComponentActivity() { fsyncFirst = SessionPrefs.fsyncFirst(this) syncFallback = SessionPrefs.syncFallback(this) }, - onSteamChannel = { id -> SessionPrefs.setSteamChannel(this, id); steamChannel = id }, onSteamRepair = { steamRepairQueued = SteamRepair.queue(this) }, - onSteamDeckMode = { on -> - SessionPrefs.setSteamDeckMode(this, on) - steamDeckMode = on - steamChannel = SessionPrefs.steamChannel(this) - }, onMangoapp = { on -> SessionPrefs.setMangoapp(this, on); mangoapp = on }, onSteamController = { id -> SessionPrefs.setSteamController(this, id); steamController = id }, onRunSteamAtStartup = { on -> @@ -1519,8 +1509,6 @@ class MainActivity : ComponentActivity() { fastSync = SessionPrefs.fastSync(this) fsyncFirst = SessionPrefs.fsyncFirst(this) syncFallback = SessionPrefs.syncFallback(this) - steamChannel = SessionPrefs.steamChannel(this) - steamDeckMode = SessionPrefs.steamDeckMode(this) steamRepairQueued = SteamRepair.queued(this) mangoapp = SessionPrefs.mangoapp(this) steamController = SessionPrefs.steamController(this) @@ -1579,7 +1567,6 @@ class MainActivity : ComponentActivity() { clientOverride = SessionPrefs.clientCpusOverride(this) glThread = SessionPrefs.glThread(this) noGlError = SessionPrefs.noGlError(this) - steamDeckMode = SessionPrefs.steamDeckMode(this) clientCores = CpuCores.parse(SessionPrefs.clientCpus(this)).ifEmpty { CpuCores.all.toSet() } gameCores = CpuCores.parse(SessionPrefs.gameCpus(this)).ifEmpty { CpuCores.all.toSet() } tuSysmem = SessionPrefs.tuSysmem(this) diff --git a/app/src/main/java/com/droiddeck/launcher/core/DeviceReport.kt b/app/src/main/java/com/droiddeck/launcher/core/DeviceReport.kt index d23021295d..5fa562da95 100644 --- a/app/src/main/java/com/droiddeck/launcher/core/DeviceReport.kt +++ b/app/src/main/java/com/droiddeck/launcher/core/DeviceReport.kt @@ -152,7 +152,6 @@ object DeviceReport { k("Zink lazy descriptors", SessionPrefs.zinkLazy(context)) k("Threaded GL (glthread)", SessionPrefs.glThread(context)) k("No GL error checks", SessionPrefs.noGlError(context)) - k("Steam Deck mode", SessionPrefs.steamDeckMode(context)) k("Steam controller", SessionPrefs.steamController(context)) k("Upscaler", (SessionPrefs.upscalerChoices.firstOrNull { it.first == SessionPrefs.upscaler(context) }?.second ?: "Off") + " (sharpness ${SessionPrefs.upscaleSharpness(context)}%)") 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 f5410a8da6..2c3f4261e8 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt @@ -131,9 +131,9 @@ object SessionPrefs { private fun hudKey(context: Context) = if (mangoappSession(context)) "hudDeck" else "hud" - /** A Steam session that runs Deck mode with its performance overlay (mangoapp). */ + /** A Steam session with Deck mode's performance overlay (mangoapp). */ private fun mangoappSession(context: Context) = - SessionState.mode == SessionService.MODE_STEAM && steamDeckMode(context) && mangoapp(context) + SessionState.mode == SessionService.MODE_STEAM && mangoapp(context) /** When enabled, a single Back opens Steam QAM and a double Back opens the session menu. */ fun backActionsInverted(context: Context): Boolean = prefs(context).getBoolean("backActionsInverted", false) @@ -456,22 +456,6 @@ object SessionPrefs { prefs(context).getString("steamController", CONTROLLER_DECK) ?: CONTROLLER_DECK fun setSteamController(context: Context, id: String) { prefs(context).edit().putString("steamController", id).apply() } - /** Runs the SteamOS gamepad client with its Quick Access performance controls. On by default (settleDeckModeDefault). */ - fun steamDeckMode(context: Context): Boolean = prefs(context).getBoolean("steamDeckMode", true) - fun setSteamDeckMode(context: Context, on: Boolean) { prefs(context).edit().putBoolean("steamDeckMode", on).apply() } - - /** - * Deck mode is the default: every install, new or from before, is moved to it once. An install - * from before 0.3.0 had off written down for it whether or not anyone chose it, so the move - * can't tell a choice from that default and moves everyone; turning it off afterwards sticks. - * Run once at process start, before anything reads or writes these prefs. - */ - fun settleDeckModeDefault(context: Context) { - val p = prefs(context) - if (p.getBoolean("deckModeMoved", false)) return - p.edit().putBoolean("steamDeckMode", true).putBoolean("deckModeMoved", true).apply() - } - /** * Deck mode's performance overlay (mangoapp, beside gamescope): the QAM's Overlay Level draws * through it. Off is the way out where Valve's mangoapp crashes (one Turnip build did). @@ -603,24 +587,6 @@ object SessionPrefs { .onFailure { android.util.Log.e("GameEnvironment", "Could not update game environment", it) } } - /** - * The Steam client branch used for the first download and forced on the command line: - * "steamdeck_publicbeta" by default, or "publicbeta" when chosen with Deck mode off. - * Deck mode always takes the Deck branch, whatever was chosen: - * with -steamos3 the client picks its own branch as SteamOS does, and on publicbeta it settled - * on steamdeck_stable - an older client it then offered as a "Software Update" in every session, - * which applying turns into the exit-42 restart loop (seen on device 2026-09-30). Earlier, Deck - * mode on publicbeta also reinstalled the same client at every start (2026-09-23). On - * steamdeck_publicbeta the client finds no update. The choice applies with Deck mode off. - */ - fun steamChannel(context: Context): String = - if (steamDeckMode(context)) "steamdeck_publicbeta" - else prefs(context).getString("steamChannel", null) ?: "steamdeck_publicbeta" - - fun setSteamChannel(context: Context, id: String) { - prefs(context).edit().putString("steamChannel", id).apply() - } - /** Whether opening DroidDeck starts a Steam session instead of showing the front end. */ fun runSteamAtStartup(context: Context): Boolean = prefs(context).getBoolean("runSteamAtStartup", false) diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt index a1ddc5c767..7d0b4219c0 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt @@ -625,8 +625,7 @@ class SessionService : Service() { guest.add("ZINK_DEBUG=compact") } // The rest of the client-interface switches (SessionPrefs): GL marshalled off the calling - // thread, no GL error checks, and the client run as SteamOS runs it (the script reads - // BL_STEAMDECK; it is the one that builds the command line). + // thread and no GL error checks. if (SessionPrefs.glThread(this)) guest.add("mesa_glthread=true") if (SessionPrefs.noGlError(this)) guest.add("MESA_NO_ERROR=1") // Mesa's shader cache as one database instead of a file per entry. Every lookup in the @@ -639,9 +638,7 @@ class SessionService : Service() { // every thread start paid a SIGSYS that proot answers; the malloc top pad grows the heap // 16 MB at a time instead of 128 KB, and every brk(2) is a proot stop too. guest.add("GLIBC_TUNABLES=glibc.pthread.rseq=0:glibc.malloc.top_pad=16777216") - if (SessionState.mode == MODE_STEAM) guest.add("BL_STEAMDECK=" + (if (SessionPrefs.steamDeckMode(this)) "1" else "0")) if (SessionState.mode == MODE_STEAM) guest.add("BL_MANGOAPP=" + (if (SessionPrefs.mangoapp(this)) "1" else "0")) - if (steamHere) guest.add("BL_STEAM_CHANNEL=" + SessionPrefs.steamChannel(this)) if (SessionState.mode == MODE_STEAM) { guest.add("BL_GAMESCOPE_STRETCH_16X9=" + (if (SessionPrefs.stretch16x9(this)) "1" else "0")) } 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 0823c8b181..975152b232 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/ModeSettingsDialog.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/ModeSettingsDialog.kt @@ -86,12 +86,8 @@ class ModeSettings( /** Steam only: SessionPrefs.SYNC_* chosen for Proton games; null outside Steam. */ val syncBackend: String? = null, val stretch16x9: 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, val steamRepairQueued: Boolean = false, - /** Steam, Deck mode: the QAM's performance overlay (mangoapp) is started. */ + /** Steam: the QAM's performance overlay (mangoapp) is started. */ val mangoapp: Boolean = true, /** Steam only: what the pad is to the client (SessionPrefs.CONTROLLER_*); null outside Steam. */ val steamController: String? = null, @@ -141,9 +137,7 @@ class ModeSettingsActions( val onForceSsbs: (Boolean) -> Unit = {}, val onSyncBackend: (String) -> Unit = {}, val onStretch16x9: (Boolean) -> Unit = {}, - val onSteamChannel: (String) -> Unit = {}, val onSteamRepair: () -> Unit = {}, - val onSteamDeckMode: (Boolean) -> Unit = {}, val onMangoapp: (Boolean) -> Unit = {}, val onSteamController: (String) -> Unit = {}, val onUnfoldedControls: (Boolean) -> Unit = {}, @@ -381,25 +375,12 @@ fun ModeSettingsPage(s: ModeSettings, a: ModeSettingsActions) { ) } } - if (steam && tab == ModeSettingsTab.STEAM && s.steamChannel != null) SettingsGroup(stringResource(R.string.mode_client)) { + if (steam && tab == ModeSettingsTab.STEAM) SettingsGroup(stringResource(R.string.mode_client)) { ToggleRow( - host, "steamdeck", stringResource(R.string.mode_deck_mode), - stringResource(R.string.mode_deck_mode_hint), - s.steamDeckMode, onChange = a.onSteamDeckMode, - ) - if (s.steamDeckMode) ToggleRow( host, "mangoapp", stringResource(R.string.mode_mangoapp), stringResource(R.string.mode_mangoapp_hint), s.mangoapp, onChange = a.onMangoapp, ) - // Deck mode fixes the branch (SessionPrefs.steamChannel); the choice is for Deck mode off. - if (s.steamDeckMode) SettingsRow(stringResource(R.string.mode_branch), stringResource(R.string.mode_branch_deck)) {} - else ChoiceRow( - host, "channel", stringResource(R.string.mode_branch), stringResource(R.string.mode_branch_hint), - listOf("publicbeta" to stringResource(R.string.mode_branch_public), "steamdeck_publicbeta" to stringResource(R.string.mode_branch_deck_beta)), s.steamChannel, - note = stringResource(R.string.mode_branch_note), - onPick = a.onSteamChannel, - ) SettingsRow( stringResource(R.string.mode_steam_repair), stringResource(if (s.steamRepairQueued) R.string.mode_steam_repair_queued else R.string.mode_steam_repair_hint), diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index ba577fdd4f..d34e7a7712 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -283,16 +283,8 @@ ¿Desinstalar Decky Loader? Elimina el loader. Tus plugins y ajustes se conservan. Cliente - Modo Steam Deck - La interfaz Deck de Steam y los controles de rendimiento de Quick Access. Se aplica en la próxima sesión. Superposición de rendimiento Desactívalo si los juegos fallan o se quedan en negro en modo Deck. Se aplica en la próxima sesión. - Rama del cliente - Beta pública de Steam Deck (requerida por el modo Deck). - Se aplica en la próxima sesión. Steam puede actualizarse una vez. - Beta pública - Beta pública de Steam Deck - El modo Deck siempre usa la beta pública de Steam Deck. Reparar el cliente de Steam Vuelve a descargar el cliente de Steam la próxima vez que se inicie Steam. Úsalo si Steam se queda en la pantalla de carga. Se conservan los juegos, la sesión iniciada y los ajustes. El cliente de Steam se volverá a descargar la próxima vez que se inicie Steam. diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index c43a7a5b63..69db570169 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -257,16 +257,8 @@ Désinstaller Decky Loader ? Supprime le chargeur. Vos plugins et paramètres seront conservés. Client - Mode Steam Deck - Interface Steam Deck et contrôles de performance à accès rapide. Prendra effet à la prochaine session. Superposition de performance Désactivez cette option si les jeux plantent ou affichent un écran noir en mode Deck. Prendra effet à la prochaine session. - Branche du client - Bêta Steam Deck (requis pour le mode Deck). - Prendra effet à la prochaine session. Steam peut se mettre à jour une fois de lui-même. - Bêta - Bêta Steam Deck - Le mode Deck utilise toujours la version bêta de Steam Deck. Illustrations Clé API SteamGridDB Votre clé diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 239c39161e..ae4d6a3d22 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -283,16 +283,8 @@ Decky Loaderをアンインストールしますか? Loaderを削除します。プラグインと設定は保持されます。 クライアント - Steam Deckモード - Steam DeckのUIとクイックアクセスパフォーマンスコントロール。次回のセッションで有効になります。 パフォーマンスオーバーレイ Deckモードでゲームがクラッシュしたり画面が真っ暗になる場合は、これをオフにしてください。次回のセッションで有効になります。 - クライアントブランチ - Steam Deckベータ版(Deckモードに必要)。 - 次回のセッションで有効になります。Steamが自動的に一度アップデートされる場合があります。 - ベータ版 - Steam Deckベータ版 - Deckモードは常にSteam Deckベータ版を使用します。 Steamクライアントを修復 次回Steamの起動時にSteamクライアントを再ダウンロードします。Steamが読み込み画面のまま進まない場合に使用してください。ゲーム、ログイン情報、設定は保持されます。 次回Steamの起動時にSteamクライアントを再ダウンロードします。 diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index f432938552..fafa45dbc8 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -283,16 +283,8 @@ Decky Loader를 제거하시겠습니까? 로더를 제거합니다. 플러그인과 설정은 유지됩니다. 클라이언트 - Steam Deck 모드 - Steam Deck UI 및 빠른 액세스 성능 제어. 다음 세션에 적용됩니다. 성능 오버레이 Deck 모드에서 게임이 충돌하거나 화면이 검게 변하면 이 옵션을 끄세요. 다음 세션에 적용됩니다. - 클라이언트 브랜치 - Steam Deck 베타(Deck 모드에 필요). - 다음 세션에 적용됩니다. Steam이 자체적으로 한 번 업데이트될 수 있습니다. - 베타 - Steam Deck 베타 - Deck 모드는 항상 Steam Deck 베타를 사용합니다. Steam 클라이언트 복구 다음에 Steam을 시작할 때 Steam 클라이언트를 다시 다운로드합니다. Steam이 로딩 화면에서 넘어가지 않을 때 사용하세요. 게임, 로그인 정보 및 설정은 유지됩니다. 다음에 Steam을 시작할 때 Steam 클라이언트를 다시 다운로드합니다. diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index fa549a4249..1f5ba73716 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -281,16 +281,8 @@ Удалить Decky Loader? Удаляет загрузчик. Ваши плагины и настройки сохранятся. Клиент - Режим Steam Deck - Интерфейс Steam Deck и управление производительностью через быстрый доступ. Вступит в силу в следующей сессии. Оверлей производительности Отключите, если игры вылетают или показывают черный экран в режиме Deck. Вступит в силу в следующей сессии. - Ветка клиента - Публичная бета Steam Deck (требуется для режима Deck). - Вступит в силу в следующей сессии. Steam может обновиться самостоятельно один раз. - Публичная бета - Публичная бета Steam Deck - Режим Deck всегда использует публичную бету Steam Deck. Восстановить клиент Steam При следующем запуске Steam клиент будет скачан заново. Используйте, если Steam зависает на экране загрузки. Игры, вход и настройки сохраняются. Клиент Steam будет скачан заново при следующем запуске Steam. diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 68de7221c3..893c2bc021 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -283,16 +283,8 @@ 卸载 Decky Loader? 移除加载器。你的插件和设置会保留。 客户端 - Steam Deck 模式 - Steam 的 Deck 界面和快捷访问性能控制。将在下次会话生效。 性能覆盖层 若游戏在 Deck 模式下崩溃或黑屏,请关闭性能覆盖层。将在下次会话生效。 - 客户端分支 - Steam Deck 公开测试版(Deck 模式所必需)。 - 将在下次会话生效。Steam 可能会自行更新一次。 - 公开测试版 - Steam Deck 公开测试版 - Deck 模式始终使用 Steam Deck 公开测试版。 修复 Steam 客户端 下次启动 Steam 时重新下载 Steam 客户端。如果 Steam 一直停在加载画面,请使用此项。游戏、登录信息和设置都会保留。 下次启动 Steam 时将重新下载 Steam 客户端。 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 1b3ce6512a..f8a2558f49 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -283,16 +283,8 @@ 解除安裝 Decky Loader? 移除載入器,你的插件和設定會保留。 用戶端 - Steam Deck 模式 - Steam 的 Deck 介面及快速存取效能控制。下次會話生效。 效能疊加層 如果在 Deck 模式下遊戲當機或黑畫面,請關閉此項。下次會話生效。 - 用戶端分支 - Steam Deck 公開測試版(Deck 模式需要)。 - 下次會話生效。Steam 可能會自行更新一次。 - 公開測試版 - Steam Deck 公開測試版 - Deck 模式一律使用 Steam Deck 公開測試版。 修復 Steam 用戶端 下次啟動 Steam 時重新下載 Steam 用戶端。如果 Steam 一直停留在載入畫面,請使用此功能。遊戲、登入資料和設定都會保留。 下次啟動 Steam 時會重新下載 Steam 用戶端。 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index d7ffa9e776..ed6630ca03 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -283,16 +283,8 @@ 解除安裝 Decky Loader? 移除載入器。你的外掛程式和設定會保留。 用戶端 - Steam Deck 模式 - Steam Deck 介面和快速存取效能控制。下次工作階段生效。 效能重疊層 如果 Deck 模式下遊戲崩潰或黑畫面,請關閉此項。下次工作階段生效。 - 用戶端分支 - Steam Deck 公開測試版(Deck 模式所需)。 - 下次工作階段生效。Steam 可能會自行更新一次。 - 公開測試版 - Steam Deck 公開測試版 - Deck 模式一律使用 Steam Deck 公開測試版。 修復 Steam 用戶端 下次啟動 Steam 時重新下載 Steam 用戶端。如果 Steam 一直停在載入畫面,請使用此功能。遊戲、登入狀態和設定都會保留。 下次啟動 Steam 時會重新下載 Steam 用戶端。 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index af1bdf4ab7..4dd9f86acd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -293,16 +293,8 @@ Uninstall Decky Loader? Removes the loader. Your plugins and settings are kept. Client - Steam Deck mode - Steam\'s Deck interface and Quick Access performance controls. Applies next session. Performance overlay Turn off if games crash or go black in Deck mode. Applies next session. - Client branch - Steam Deck public beta (required by Deck mode). - Applies next session. Steam may update itself once. - Public beta - Steam Deck public beta - Deck mode always uses Steam Deck public beta. Repair Steam client Downloads the Steam client again the next time Steam starts. Use it if Steam stays on its loading screen. Games, sign-in and settings are kept. The Steam client will be downloaded again the next time Steam starts. diff --git a/app/src/test/java/com/droiddeck/launcher/session/SteamChannelTest.kt b/app/src/test/java/com/droiddeck/launcher/session/SteamChannelTest.kt deleted file mode 100644 index 8a4195950e..0000000000 --- a/app/src/test/java/com/droiddeck/launcher/session/SteamChannelTest.kt +++ /dev/null @@ -1,42 +0,0 @@ -package com.droiddeck.launcher.session - -import android.content.Context -import org.junit.Assert.assertEquals -import org.junit.Before -import org.junit.Test -import org.junit.runner.RunWith -import org.robolectric.RobolectricTestRunner -import org.robolectric.RuntimeEnvironment -import org.robolectric.annotation.Config - -@RunWith(RobolectricTestRunner::class) -@Config(sdk = [28], manifest = Config.NONE) -class SteamChannelTest { - private lateinit var context: Context - - @Before fun setUp() { - context = RuntimeEnvironment.getApplication() - context.getSharedPreferences("session", Context.MODE_PRIVATE).edit().clear().commit() - } - - @Test fun freshSettingsDefaultToDeckBetaWithOrWithoutDeckMode() { - assertEquals("steamdeck_publicbeta", SessionPrefs.steamChannel(context)) - SessionPrefs.setSteamDeckMode(context, false) - assertEquals("steamdeck_publicbeta", SessionPrefs.steamChannel(context)) - } - - @Test fun explicitChannelIsPreservedWhenDeckModeIsOff() { - SessionPrefs.setSteamDeckMode(context, false) - SessionPrefs.setSteamChannel(context, "publicbeta") - assertEquals("publicbeta", SessionPrefs.steamChannel(context)) - SessionPrefs.setSteamChannel(context, "steamdeck_publicbeta") - assertEquals("steamdeck_publicbeta", SessionPrefs.steamChannel(context)) - } - - @Test fun deckModeUsesDeckBetaAndRestoresSavedSelectionWhenDisabled() { - SessionPrefs.setSteamChannel(context, "publicbeta") - assertEquals("steamdeck_publicbeta", SessionPrefs.steamChannel(context)) - SessionPrefs.setSteamDeckMode(context, false) - assertEquals("publicbeta", SessionPrefs.steamChannel(context)) - } -} diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-session b/tools/linuxfs/overlay/usr/local/bin/droiddeck-session index d8cd264825..94d9a69370 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-session +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-session @@ -264,12 +264,12 @@ if [ -z "${BL_INSIDE:-}" ]; then [ "${BL_HDR:-0}" = 1 ] && args+=(--hdr-enabled) # Extra gamescope arguments for an experiment (--debug-focus, say), from Download/droiddeck-env. [ -n "${BL_GAMESCOPE_ARGS:-}" ] && read -r -a _bl_extra <<<"$BL_GAMESCOPE_ARGS" && args+=("${_bl_extra[@]}") - # Deck mode's performance overlay (Quick Access Menu → Performance → Overlay Level) is drawn by + # The performance overlay (Quick Access Menu → Performance → Overlay Level) is drawn by # mangoapp, which gamescope starts beside the client; the client sets the level by rewriting # MANGOHUD_CONFIGFILE. The apk stages Valve's aarch64 build (tools/mangoapp) - without it the menu # still offers the levels and nothing appears. Starts hidden until the client writes a level. # BL_MANGOAPP=0 turns it off (one community build found Valve's mangoapp crashing on Turnip). - if [ "$mode" = steam ] && [ "${BL_STEAMDECK:-0}" = 1 ] && [ "${BL_MANGOAPP:-1}" = 1 ] \ + if [ "$mode" = steam ] && [ "${BL_MANGOAPP:-1}" = 1 ] \ && [ "${BL_STEAM_UI:-}" != desktop ] && command -v mangoapp >/dev/null 2>&1; then MANGOHUD_CONFIGFILE=$(mktemp /tmp/mangohud.XXXXXXXX) echo no_display > "$MANGOHUD_CONFIGFILE" @@ -821,7 +821,7 @@ 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 Steam page's Client settings): -steamdeck is the flag that puts + # Deck mode, always outside the desktop UI: -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 @@ -829,7 +829,7 @@ BUSCONF # 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 + if [ "${BL_STEAM_UI:-}" != desktop ]; then _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 @@ -851,13 +851,16 @@ BUSCONF [ -n "$_stale" ] && echo "== steam: cleared what an earlier session left:$_stale" unset _stale _f fi - # Use the same configured branch as the first-run download. Whatever wrote package/beta, the branch on - # disk has to agree with the one forced here - a disagreement is the restart loop above, and - # it is silent apart from rc=42 in this log. + # The Deck's beta branch, the one the first-run download takes: with -steamos3 on publicbeta + # the client settled on steamdeck_stable, an older client it then offered as a "Software + # Update" every session (2026-09-30); on steamdeck_publicbeta it finds no update. Whatever + # wrote package/beta, the branch on disk has to agree with the one forced here - a + # disagreement is the restart loop above, and it is silent apart from rc=42 in this log. A + # client installed from publicbeta by an older app moves over this way at its next start. # Checked before every start, not once: the client rewrites package/beta during its own run, # and a restart below (rc=42, or the one after the ARM64 Proton lands) would otherwise start it # again on the branch it just wrote. - steam_channel=${BL_STEAM_CHANNEL:-steamdeck_publicbeta} + steam_channel=steamdeck_publicbeta # The app's language (Setup, or the system's): the client's interface takes -language over its # registry, and the registry is rewritten before each start below for its update window. _bl_lang=() diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-install b/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-install index d2f59ed12f..0eae6d0d27 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-install +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-install @@ -3,11 +3,9 @@ # The client is not redistributable, so the runtime ships this script instead of the client. set -eu cdn=https://client-update.fastly.steamstatic.com -steam_channel=${BL_STEAM_CHANNEL:-steamdeck_publicbeta} -case "$steam_channel" in - publicbeta|steamdeck_publicbeta) ;; - *) echo "droiddeck-steam-install: unsupported Steam channel: $steam_channel" >&2; exit 1 ;; -esac +# The Deck's beta branch, which droiddeck-session forces on the command line too. A client already +# on disk from another branch is left for the client to move (droiddeck-session's package/beta). +steam_channel=steamdeck_publicbeta manifest=steam_client_${steam_channel}_linuxarm64 steam_root=${XDG_DATA_HOME:-$HOME/.local/share}/Steam stamp=$steam_root/package/droiddeck-installed diff --git a/tools/tests/test_steam_install.py b/tools/tests/test_steam_install.py index e62bba375f..f3e29bbe26 100644 --- a/tools/tests/test_steam_install.py +++ b/tools/tests/test_steam_install.py @@ -45,8 +45,7 @@ cp "$TEST_CDN/${2##*/}" "$4" self.env = dict(os.environ, HOME=str(self.home), XDG_DATA_HOME=str(self.data), PATH=str(self.bin) + os.pathsep + os.environ['PATH'], TEST_CDN=str(self.cdn), TEST_REQUESTS=str(self.requests)) - self.env.pop('BL_STEAM_CHANNEL', None) - for channel in ('publicbeta', 'steamdeck_publicbeta'): + for channel in ('steamdeck_publicbeta',): archive = self.cdn / (channel + '.zip') with zipfile.ZipFile(archive, 'w') as package: package.writestr('steamrtarm64/steam', channel) @@ -58,14 +57,11 @@ cp "$TEST_CDN/${2##*/}" "$4" f'\t\t"file" "{archive.name}"\n\t\t"sha2" "{digest}"\n' '\t}\n}\n') - def install(self, channel=None): - env = self.env.copy() - if channel is not None: - env['BL_STEAM_CHANNEL'] = channel - return subprocess.run(['bash', str(SCRIPT)], env=env, text=True, capture_output=True) + def install(self): + return subprocess.run(['bash', str(SCRIPT)], env=self.env, text=True, capture_output=True) - def assert_installed(self, channel): - result = self.install(channel) + def assert_installed(self, channel='steamdeck_publicbeta'): + result = self.install() self.assertEqual(0, result.returncode, result.stderr) self.assertEqual(channel + '\n', (self.steam / 'package/beta').read_text()) self.assertEqual('123456\n', (self.steam / 'package/droiddeck-installed').read_text()) @@ -78,38 +74,31 @@ cp "$TEST_CDN/${2##*/}" "$4" 'https://client-update.fastly.steamstatic.com/' + channel + '.zip', ], self.requests.read_text().splitlines()) - def test_unset_channel_downloads_deck_beta(self): + def test_downloads_the_deck_beta_client(self): + self.assert_installed() + + def test_an_install_from_another_branch_is_left_for_steam_to_move(self): + # An older app could install publicbeta; droiddeck-session moves the client at its start. + self.assert_installed() + requests = self.requests.read_text() + (self.steam / 'package/beta').write_text('publicbeta\n') result = self.install() self.assertEqual(0, result.returncode, result.stderr) - self.assertEqual('steamdeck_publicbeta\n', (self.steam / 'package/beta').read_text()) - self.assertIn('/steam_client_steamdeck_publicbeta_linuxarm64\n', self.requests.read_text()) - - def test_explicit_deck_beta_downloads_matching_client(self): - self.assert_installed('steamdeck_publicbeta') - - def test_explicit_public_beta_downloads_matching_client(self): - self.assert_installed('publicbeta') - - def test_existing_install_is_left_for_steam_to_update(self): - self.assert_installed('steamdeck_publicbeta') - requests = self.requests.read_text() - result = self.install('publicbeta') - self.assertEqual(0, result.returncode, result.stderr) self.assertEqual(requests, self.requests.read_text()) - self.assertEqual('steamdeck_publicbeta\n', (self.steam / 'package/beta').read_text()) - - def test_failed_download_has_no_ready_marker_and_can_retry(self): - archive = self.cdn / 'publicbeta.zip' - original = archive.read_bytes() - archive.write_bytes(b'corrupt download') - self.assertNotEqual(0, self.install('publicbeta').returncode) - self.assertFalse((self.steam / 'package/droiddeck-installed').exists()) - archive.write_bytes(original) - self.assertEqual(0, self.install('publicbeta').returncode) self.assertEqual('publicbeta\n', (self.steam / 'package/beta').read_text()) + def test_failed_download_has_no_ready_marker_and_can_retry(self): + archive = self.cdn / 'steamdeck_publicbeta.zip' + original = archive.read_bytes() + archive.write_bytes(b'corrupt download') + self.assertNotEqual(0, self.install().returncode) + self.assertFalse((self.steam / 'package/droiddeck-installed').exists()) + archive.write_bytes(original) + self.assertEqual(0, self.install().returncode) + self.assertEqual('steamdeck_publicbeta\n', (self.steam / 'package/beta').read_text()) + def break_client(self, starts): - self.assert_installed('steamdeck_publicbeta') + self.assert_installed() self.requests.unlink() package = self.steam / 'package' (self.steam / 'steamrtarm64/steam').write_text('half updated') @@ -125,7 +114,7 @@ cp "$TEST_CDN/${2##*/}" "$4" def test_two_starts_with_nothing_shown_fetch_the_client_again(self): package = self.break_client(2) - self.assert_installed('steamdeck_publicbeta') + self.assert_installed() self.assertEqual('repaired\n', (package / 'droiddeck-unconfirmed').read_text()) self.assertFalse((self.steam / '.crash').exists()) self.assertEqual([], sorted(p.name for p in package.glob('steam_client_*'))) @@ -161,18 +150,12 @@ cp "$TEST_CDN/${2##*/}" "$4" self.assertFalse((package / 'droiddeck-installed').exists()) archive.write_bytes(original) self.requests.unlink() - self.assert_installed('steamdeck_publicbeta') + self.assert_installed() self.assertFalse(request.exists()) self.requests.unlink() self.assertEqual(0, self.install().returncode) self.assertFalse(self.requests.exists()) - def test_invalid_channel_fails_before_any_download(self): - result = self.install('../unknown') - self.assertNotEqual(0, result.returncode) - self.assertIn('unsupported Steam channel', result.stderr) - self.assertFalse(self.requests.exists()) - if __name__ == '__main__': unittest.main()