From c013252a59150edd5c4b47c4d00a1485b05a75a2 Mon Sep 17 00:00:00 2001 From: xXJsonDeruloXx Date: Wed, 23 Sep 2026 17:26:27 -0400 Subject: [PATCH] Expose Back actions in app settings --- app/src/main/java/com/steamdeck/launcher/MainActivity.kt | 6 ++++++ .../main/java/com/steamdeck/launcher/SessionActivity.kt | 3 ++- .../main/java/com/steamdeck/launcher/ui/FrontEndScreen.kt | 8 ++++++++ docs/progress-log.md | 6 +++--- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/steamdeck/launcher/MainActivity.kt b/app/src/main/java/com/steamdeck/launcher/MainActivity.kt index 01db50bd7..021019d3e 100644 --- a/app/src/main/java/com/steamdeck/launcher/MainActivity.kt +++ b/app/src/main/java/com/steamdeck/launcher/MainActivity.kt @@ -211,6 +211,7 @@ class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) theme = SessionPrefs.theme(this) + backActionsInverted = SessionPrefs.backActionsInverted(this) setContent { SteamDeckTheme(theme) { val sm = settingsMode @@ -241,6 +242,7 @@ class MainActivity : ComponentActivity() { packageStage = pkgStage, packagePercent = pkgPercent, sessionRunning = SessionState.running, + backActionsInverted = backActionsInverted, ), FrontEndActions( onPlay = { startSession(Intent(this, SessionActivity::class.java)) }, @@ -301,6 +303,10 @@ class MainActivity : ComponentActivity() { onTheme = { id -> SessionPrefs.setTheme(this, id); theme = id }, onHomeApp = { manageHomeApp() }, onAndroidApp = { app -> launchAndroidApp(app) }, + onBackActionsInverted = { inverted -> + SessionPrefs.setBackActionsInverted(this, inverted) + backActionsInverted = inverted + }, ), page = page, ) diff --git a/app/src/main/java/com/steamdeck/launcher/SessionActivity.kt b/app/src/main/java/com/steamdeck/launcher/SessionActivity.kt index 608f3652f..181684e2b 100644 --- a/app/src/main/java/com/steamdeck/launcher/SessionActivity.kt +++ b/app/src/main/java/com/steamdeck/launcher/SessionActivity.kt @@ -284,7 +284,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { performBackAction(double = false) } pendingBackAction = pending - uiHandler.postDelayed(pending, android.view.ViewConfiguration.getDoubleTapTimeout().toLong()) + uiHandler.postDelayed(pending, BACK_DOUBLE_PRESS_TIMEOUT_MS) } private fun performBackAction(double: Boolean) { @@ -1005,6 +1005,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { companion object { private const val TAG = "SessionActivity" + private const val BACK_DOUBLE_PRESS_TIMEOUT_MS = 500L /** Compositor scale modes (Container.FULLSCREEN_* values): 1 = fit with bars, centred. */ private const val SCALE_FIT = 1 private const val ALIGN_CENTER = 0 diff --git a/app/src/main/java/com/steamdeck/launcher/ui/FrontEndScreen.kt b/app/src/main/java/com/steamdeck/launcher/ui/FrontEndScreen.kt index fb374b5a5..cff70d69c 100644 --- a/app/src/main/java/com/steamdeck/launcher/ui/FrontEndScreen.kt +++ b/app/src/main/java/com/steamdeck/launcher/ui/FrontEndScreen.kt @@ -141,6 +141,7 @@ class FrontEndState( val packageStage: String? = null, val packagePercent: Int = -1, val sessionRunning: Boolean = false, + val backActionsInverted: Boolean = false, ) class FrontEndActions( @@ -169,6 +170,7 @@ class FrontEndActions( val onTheme: (String) -> Unit = {}, val onHomeApp: () -> Unit = {}, val onAndroidApp: (com.steamdeck.launcher.HomeApp.LaunchableApp) -> Unit = {}, + val onBackActionsInverted: (Boolean) -> Unit = {}, ) @@ -692,6 +694,12 @@ private fun SetupPanel(s: FrontEndState, a: FrontEndActions) { ActionRow("ROMs folder", s.romsDir ?: "Choose where emulator games are stored", "Choose", a.onRoms) } SettingsGroup("Session") { + ToggleRow( + host, "back-actions", "Invert Back actions", + if (s.backActionsInverted) "Back once opens Steam QAM; twice opens the in-session menu." + else "Back once opens the in-session menu; twice opens Steam QAM.", + s.backActionsInverted, onChange = a.onBackActionsInverted, + ) SettingsRow("Frame generation", "Select the frame generation mode") { Box { ValueChip(s.frameGenLabel, host.open == "fg") { host.open = if (host.open == "fg") null else "fg" } diff --git a/docs/progress-log.md b/docs/progress-log.md index 254fe6f62..6d3c9282d 100644 --- a/docs/progress-log.md +++ b/docs/progress-log.md @@ -188,9 +188,9 @@ State: **main = `90c7574`** (PR #14 merge), main build run 35895701784. No tag, - Thor Pro: trackpad tap; the 1–2 min in-game crash once a `crash.log` arrives. - Xfce as a second desktop shell (Max's branch runs XFCE 4.20 on labwc) - a catalog package + a shell choice in the Desktop cog; comfort, not performance. -- Quick Access Menu for non-Deck pads - Back double-press now routes to the existing Guide+A chord; - the in-session and Steam settings can swap the single- and double-Back actions. Device confirmation - is still needed. +- Quick Access Menu for non-Deck pads - Back double-press (500 ms) now routes to the existing Guide+A + chord; the in-session menu, Steam settings, and Setup › Session can swap the single- and double-Back + actions. Device confirmation is still needed. - FlatOut shrink: try `vk_wsi_force_swapchain_to_current_extent=false` via `steamdeck-env`. - Max's stricter `winnative-directaudio` guards; `winnative-epic-launch` (a feature). - Rename before anything truly public: "SteamDeck" is Valve's mark.