Expose Back actions in app settings

This commit is contained in:
xXJsonDeruloXx committed 2026-09-23 17:26:27 -04:00
1 parent 7fa71dc5c5
commit c013252a59
4 files changed
+19 -4

No files matched your search

@@ -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,
)
@@ -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
@@ -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" }
+3 -3
View File
@@ -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.