Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ece9f7cd46 | ||
|
|
16dab991e0 | ||
|
|
c17975943a | ||
|
|
9d9ee98eaf | ||
|
|
b0bcac6926 | ||
|
|
3b7ad53994 | ||
|
|
0fedfae1e6 | ||
|
|
3fa2a35c12 | ||
|
|
a39859a39e | ||
|
|
d2f4a84314 | ||
|
|
0959eacf39 | ||
|
|
78c4b3b264 | ||
|
|
9f4a841eb6 | ||
|
|
9b034fcbb2 | ||
|
|
81cf964168 | ||
|
|
b5158210a9 | ||
|
|
d1602710a8 | ||
|
|
ec1453831d | ||
|
|
c63af629ac | ||
|
|
916b1d46fc | ||
|
|
7df694fe49 | ||
|
|
071289b56e | ||
|
|
eca355016c | ||
|
|
0053d12407 | ||
|
|
4d6ee985b9 | ||
|
|
94d74d35db | ||
|
|
d6a157578d | ||
|
|
0b9f3106fe | ||
|
|
17c75bf671 | ||
|
|
d6a9c2ed90 | ||
|
|
9931dc13a7 | ||
|
|
4a3d5a7d66 | ||
|
|
ac2cfc1266 |
No files matched your search
@@ -7,6 +7,10 @@ build/
|
||||
captures/
|
||||
.externalNativeBuild/
|
||||
.cxx/
|
||||
.kotlin/
|
||||
# Built in CI from tools/linuxfs and app/src/main/cpp/fakeinput.cpp, never committed, so the two
|
||||
# copies cannot drift.
|
||||
app/src/main/assets/linuxfs/
|
||||
|
||||
# Kotlin compiler session files (build-tool state, never source).
|
||||
.kotlin/
|
||||
@@ -6,6 +6,14 @@ the timeline, then lessons and backlog. Companion to the README (what the app *d
|
||||
|
||||
---
|
||||
|
||||
## 🔖 0.1.5 RELEASED 2026-09-23 03:17 — known-good point
|
||||
|
||||
- **Tag `0.1.5` = `d2f4a84`** (bump commit, versionCode 6), notes `docs/releases/0.1.5.md` on main after it. Private release [0.1.5](https://github.com/The412Banner/SteamDeck/releases/tag/0.1.5) and public [`SteamDeck-0.1.5`](https://github.com/The412Banner/winlator-contents/releases/tag/SteamDeck-0.1.5) on winlator-contents, both Latest, asset `SteamDeck-0.1.5.apk` 21,093,959 bytes, sha256 `85b42954…`, run 35813465422. Staged as `/sdcard/Download/SteamDeck-0.1.5.apk`.
|
||||
- What went in since 0.1.4 (58 commits): the motion front end, settings as pages with anchored menus, the session drawer, three themes (Paper default) and the new icon, run-as-a-game + libpci fix (117 fps Big Picture on a Fold), client-interface switches, FEX presets, 720p default, TZ, non-Adreno gate, 16 KB app libs, two on-screen sticks + bar-aware layout, folded categories at launch, Kurt's #3 (Back key) / #4 (icon) / #5 (local build helpers), pull-request CI + contributions ledger.
|
||||
- Untested at release: sticks/bar layout, FEX presets, Deck mode, desktop → Steam hand-off, the `perf:` line. Rollback: `git reset --hard 8e58e8e` (0.1.4) + `SteamDeck-0.1.4.apk`.
|
||||
- After the cut: the public release on winlator-contents got the private title, and that repo's README a SteamDeck section (latest release, `linuxfs.json`, `desktop.json`) — refresh both at every cut. Verified on the FIT's client binary: there is no `-steampal` flag; the Deck flags are `-steamdeck` / `-steamos3` (Deck mode on the Performance page), `-gamepadui`, `-steamos`.
|
||||
- **Next, in order:** (1) device pass of 0.1.5 — sticks in a game and the bar layout on the Fold, the `perf:` line and 720p in a session log, a FEX preset, the desktop → Steam hand-off; (2) decide the stick click gesture (double tap or long press); (3) Kurt's draft PR #1 (Decky installer) builds when he marks it ready — it compiles against main, minus two stray `.kotlin` files; (4) rebuild the six PulseAudio prebuilts 16 KB-aligned; (5) optional FIFO/mailbox switch on the compositor's Vulkan present path; (6) the rename away from Valve marks is still open (icon is now the "A").
|
||||
|
||||
## 2026-09-22 (late) — motion front end + run-as-a-game, branch `feat/frontend-motion` (unmerged)
|
||||
|
||||
- Front end rebuilt around a motion system (`ui/FrontEndScreen.kt`, same state/actions API): the rail's selection is one pill that springs between rows; sub-lists unfold and stagger their children; a page change sinks out and cascades in over a blurred wash of the selection's art; tiles lift/ring/shine on focus and pop a play badge; the launch button sweeps a sheen and squashes on press; the session activity rises over the front end (`res/anim/session_*`). Durations follow the system animator scale.
|
||||
@@ -16,6 +24,7 @@ the timeline, then lessons and backlog. Companion to the README (what the app *d
|
||||
- r5 `1ba803b` + TZ in the guest; r6 `39272cf` Setup folds, "Linux desktop environment", help link above the grid (r4 seen running on the FIT); r7 `af3f377` settings without a pop-up: the cog and Performance are pages in the pane with anchored menus under each value, frame generation / logs / offline open in place on the rail. **r7 merged fast-forward to `main` (`af3f377`) and main's auto-build staged as `SteamDeck-r52.apk`; no tag, no release.**
|
||||
- r8 `90ff23a` (branch only, unmerged): the session drawer in the front end's dress with the same rows and menus (Now / Next session / leave), FEXCore presets carried over from Bannerlator (`core/FexPreset`, Steam settings page + drawer, FEX_* into the Steam session's environment; default = FEX defaults as before), file manager and picker locked to landscape.
|
||||
- Collaborators: `maxjivi05` (push) and `xXJSONDeruloXx` (push, invited 2026-09-22) on the private repo.
|
||||
- CI for pull requests (2026-09-23 early): `Build APK` runs on `pull_request_target` against main (a conflicting pull request never fires `pull_request`), checks the pull request out at its head with full history, merges main itself, and leaves one comment kept current: mergeable + built (apk on the run), or the conflicting files and hunks, or the compiler's errors from the kept Gradle log. Drafts wait. Fork pull requests may run without approval (repo setting). Proven with a throwaway pull request (#2, closed) both ways. `Contributions ledger` rewrites the README's contributors table on open/merge/close via `.github/scripts/contributions.sh`, committed to main by the Actions bot.
|
||||
|
||||
## 🔖 Checkpoint 2026-09-22 22:xx — known-good point for the front end
|
||||
|
||||
|
||||
@@ -26,9 +26,13 @@ _From the repository's pull requests; rewritten when one is opened, merged or cl
|
||||
|
||||
| Contributor | Pull request | Opened | State |
|
||||
|---|---|---|---|
|
||||
| [@xXJSONDeruloXx](https://github.com/xXJSONDeruloXx) | [#1](https://github.com/The412Banner/SteamDeck/pull/1) initial decky installer stuff | 2026-09-23 | draft |
|
||||
| [@xXJSONDeruloXx](https://github.com/xXJSONDeruloXx) | [#1](https://github.com/The412Banner/SteamDeck/pull/1) initial decky installer stuff | 2026-09-23 | closed |
|
||||
| [@xXJSONDeruloXx](https://github.com/xXJSONDeruloXx) | [#3](https://github.com/The412Banner/SteamDeck/pull/3) Fix hardware back in Steam session | 2026-09-23 | merged 2026-09-23 |
|
||||
| [@xXJSONDeruloXx](https://github.com/xXJSONDeruloXx) | [#4](https://github.com/The412Banner/SteamDeck/pull/4) Update app launcher icon | 2026-09-23 | merged 2026-09-23 |
|
||||
| [@xXJSONDeruloXx](https://github.com/xXJSONDeruloXx) | [#5](https://github.com/The412Banner/SteamDeck/pull/5) Add reproducible local build and deploy helpers | 2026-09-23 | merged 2026-09-23 |
|
||||
| [@xXJSONDeruloXx](https://github.com/xXJSONDeruloXx) | [#6](https://github.com/The412Banner/SteamDeck/pull/6) Add Steam and QAM touch controls | 2026-09-23 | merged 2026-09-23 |
|
||||
|
||||
- **@xXJSONDeruloXx**: 1 submitted, 0 merged
|
||||
- **@xXJSONDeruloXx**: 5 submitted, 4 merged
|
||||
<!-- contributions:end -->
|
||||
|
||||
## Requirements
|
||||
@@ -139,10 +143,27 @@ first use.
|
||||
|
||||
## Building
|
||||
|
||||
Nothing is built locally. Push, and the `Build APK` workflow produces `steamdeck-apk`, a
|
||||
debug-signed arm64 apk. It cross-compiles the two glibc preloads the session needs
|
||||
(`libfakeinput.so`, `libblsession.so`) from the sources in this repo before the app build, so
|
||||
those can never drift from what ships.
|
||||
The repeatable local build is `tools/build_local.sh`. It uses Docker's Ubuntu cross-toolchain for
|
||||
the two glibc ARM64 preloads (`libfakeinput.so`, `libblsession.so`), the Android SDK/NDK already
|
||||
installed on the machine, and the same release signing and native dependency checks as CI. The
|
||||
APK is written to `app/build/outputs/apk/release/app-release.apk`.
|
||||
|
||||
```sh
|
||||
tools/build_local.sh
|
||||
```
|
||||
|
||||
CI remains available through the `Build APK` workflow. Both paths cross-compile the preloads from
|
||||
the sources in this repo before the app build, so those cannot drift from what ships.
|
||||
|
||||
With an authorized Android device attached over USB or ADB, install the locally built APK with:
|
||||
|
||||
```sh
|
||||
tools/deploy_local.sh
|
||||
```
|
||||
|
||||
Set `ADB_SERIAL` when more than one device is attached. The deploy helper installs over the
|
||||
existing `com.steamdeck.launcher` package using the repository's stable test key and verifies the
|
||||
package path afterward; it does not launch a session automatically.
|
||||
|
||||
## If Bannerlator is already installed
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ android {
|
||||
compileSdk 34
|
||||
// The NDK is pinned by property so CI can hand in whatever the runner already has rather than
|
||||
// downloading a second copy; see gradle.properties.
|
||||
ndkVersion project.findProperty('ndkVersion') ?: '27.0.12077973'
|
||||
ndkVersion project.findProperty('ndkVersion') ?: '27.3.13750724'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.steamdeck.launcher"
|
||||
@@ -18,8 +18,8 @@ android {
|
||||
// file out of its own data directory, and this app's entire job is to exec a rootfs:
|
||||
// proot, gamescope, the Steam client and everything it launches all live under files/.
|
||||
targetSdkVersion 28
|
||||
versionCode 5
|
||||
versionName "0.1.4"
|
||||
versionCode 6
|
||||
versionName "0.1.5"
|
||||
|
||||
ndk {
|
||||
abiFilters 'arm64-v8a'
|
||||
|
||||
@@ -123,6 +123,7 @@ class MainActivity : ComponentActivity() {
|
||||
private var settingsMode by mutableStateOf<String?>(null)
|
||||
private var resolutionCap by mutableStateOf(1080)
|
||||
private var fexPreset by mutableStateOf("")
|
||||
private var theme by mutableStateOf("paper")
|
||||
private var shapeMode by mutableStateOf(SessionPrefs.SHAPE_AUTO)
|
||||
private var hdrOn by mutableStateOf(false)
|
||||
private var hdrReason by mutableStateOf<String?>(null)
|
||||
@@ -151,8 +152,9 @@ class MainActivity : ComponentActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
theme = SessionPrefs.theme(this)
|
||||
setContent {
|
||||
SteamDeckTheme {
|
||||
SteamDeckTheme(theme) {
|
||||
val sm = settingsMode
|
||||
val page: (@Composable () -> Unit)? = when {
|
||||
sm != null -> { { ModeSettingsHost(sm) } }
|
||||
@@ -170,6 +172,7 @@ class MainActivity : ComponentActivity() {
|
||||
frameGenEngine = FrameGen.engine(this), frameGenMultiplier = FrameGen.multiplier(this),
|
||||
lsfgReady = LsfgNative.isInstalled(this),
|
||||
pageKey = sm?.let { "settings:$it" } ?: if (showPerformance) "performance" else null,
|
||||
theme = theme,
|
||||
),
|
||||
FrontEndActions(
|
||||
onPlay = { startActivity(Intent(this, SessionActivity::class.java)) },
|
||||
@@ -218,6 +221,7 @@ class MainActivity : ComponentActivity() {
|
||||
onEmulatorHelp = { showEmulatorHelp = true },
|
||||
onCredits = { showCredits = true },
|
||||
onPageBack = { settingsMode = null; showPerformance = false },
|
||||
onTheme = { id -> SessionPrefs.setTheme(this, id); theme = id },
|
||||
),
|
||||
page = page,
|
||||
)
|
||||
|
||||
@@ -183,6 +183,10 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
padBridge?.applyTouch { st -> st.setPressed(com.steamdeck.launcher.input.GamepadState.IDX_BUTTON_MODE.toInt(), false) }
|
||||
}, 90)
|
||||
}) else null,
|
||||
onQam = if (SessionState.mode == SessionService.MODE_STEAM) ({
|
||||
drawerOpen = false
|
||||
padBridge?.triggerQam()
|
||||
}) else null,
|
||||
onProtons = { refreshProtons(); showProtons = true },
|
||||
onOsc = { v -> SessionPrefs.setOscMode(this@SessionActivity, v); readPrefs(); updateOnScreenControls() },
|
||||
onTouch = { v -> SessionPrefs.setTouchMode(this@SessionActivity, v); readPrefs() },
|
||||
@@ -504,7 +508,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
KeyEvent.KEYCODE_VOLUME_UP, KeyEvent.KEYCODE_VOLUME_DOWN, KeyEvent.KEYCODE_VOLUME_MUTE ->
|
||||
return super.dispatchKeyEvent(event)
|
||||
}
|
||||
if (padBridge?.onKeyEvent(event) == true) return true
|
||||
if (event.keyCode != KeyEvent.KEYCODE_BACK && padBridge?.onKeyEvent(event) == true) return true
|
||||
// A hardware keyboard, forwarded to the compositor's wl_keyboard. Back is left to the
|
||||
// activity, which opens the drawer.
|
||||
val fromPad = event.device != null && PadBridge.isFromController(event.device)
|
||||
@@ -651,25 +655,29 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* The drawer's mode ("always" / "never") decides outright; on "auto" the controls follow
|
||||
* what is attached. `steamdeck-osc` in Downloads still overrides, for a device we cannot reach.
|
||||
*/
|
||||
/** The mode decides which controls appear; `steamdeck-osc` in Downloads still overrides. */
|
||||
private fun updateOnScreenControls() {
|
||||
val forced = File(Environment.getExternalStorageDirectory(), "Download/steamdeck-osc")
|
||||
.takeIf { it.isFile }
|
||||
?.let { FileUtils.readString(it)?.trim()?.lowercase() }
|
||||
?: SessionPrefs.oscMode(this)
|
||||
val controls = onScreenControls ?: return
|
||||
val buttonsOnly = forced == SessionPrefs.OSC_STEAM_QAM
|
||||
controls.setButtonsOnly(buttonsOnly)
|
||||
val show = when (forced) {
|
||||
SessionPrefs.OSC_ALWAYS -> true
|
||||
SessionPrefs.OSC_STEAM_QAM -> true
|
||||
SessionPrefs.OSC_NEVER -> false
|
||||
else -> !PadBridge.anyControllerConnected()
|
||||
}
|
||||
val controls = onScreenControls ?: return
|
||||
if (show == (controls.visibility == View.VISIBLE)) return
|
||||
if (!show) controls.releaseAll()
|
||||
controls.visibility = if (show) View.VISIBLE else View.GONE
|
||||
Log.i(TAG, "on-screen controls " + (if (show) "shown" else "hidden"))
|
||||
Log.i(TAG, "on-screen controls " + when {
|
||||
!show -> "hidden"
|
||||
buttonsOnly -> "Steam + QAM"
|
||||
else -> "full pad"
|
||||
})
|
||||
}
|
||||
|
||||
// ── Lifecycle ───────────────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -46,7 +46,7 @@ class OnScreenControls(context: Context, private val pad: PadBridge) : View(cont
|
||||
var ky = 0f
|
||||
/** A stick that moved or was let go: its axes are written once, then left alone. */
|
||||
var dirty = false
|
||||
fun contains(x: Float, y: Float): Boolean {
|
||||
fun contains(x: Float, y: Float, radius: Float = this.radius): Boolean {
|
||||
val dx = x - cx
|
||||
val dy = y - cy
|
||||
// A generous hit area: a finger on glass is not a mouse, and a miss in Big Picture
|
||||
@@ -84,8 +84,11 @@ class OnScreenControls(context: Context, private val pad: PadBridge) : View(cont
|
||||
Control("start", "☰", 7, -1, -1, dp(20f)),
|
||||
// The client's own in-game menu; the interposer publishes it as BTN_MODE.
|
||||
Control("guide", "◉", GamepadState.IDX_BUTTON_MODE.toInt(), -1, -1, dp(22f)),
|
||||
Control("qam", "⋯", -1, -1, -1, dp(22f)),
|
||||
)
|
||||
|
||||
private var buttonsOnly = false
|
||||
|
||||
private val fill = Paint(Paint.ANTI_ALIAS_FLAG).apply { style = Paint.Style.FILL }
|
||||
private val stroke = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
||||
style = Paint.Style.STROKE
|
||||
@@ -107,6 +110,14 @@ class OnScreenControls(context: Context, private val pad: PadBridge) : View(cont
|
||||
if (width > 0 && height > 0) { layoutControls(width.toFloat(), height.toFloat()); invalidate() }
|
||||
}
|
||||
|
||||
fun setButtonsOnly(enabled: Boolean) {
|
||||
if (buttonsOnly == enabled) return
|
||||
releaseAll()
|
||||
buttonsOnly = enabled
|
||||
if (width > 0 && height > 0) layoutControls(width.toFloat(), height.toFloat())
|
||||
invalidate()
|
||||
}
|
||||
|
||||
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
||||
super.onSizeChanged(w, h, oldw, oldh)
|
||||
layoutControls(w.toFloat(), h.toFloat())
|
||||
@@ -118,6 +129,12 @@ class OnScreenControls(context: Context, private val pad: PadBridge) : View(cont
|
||||
* the bottom corners in every one; nothing is placed where a game's own HUD usually is.
|
||||
*/
|
||||
private fun layoutControls(w: Float, h: Float) {
|
||||
if (buttonsOnly) {
|
||||
val inset = dp(44f)
|
||||
place("guide", inset, h - inset)
|
||||
place("qam", w - inset, h - inset)
|
||||
return
|
||||
}
|
||||
val p = picture
|
||||
val sideBar = if (p != null) minOf(p.left, w - p.right) else 0f
|
||||
val bottomBand = if (p != null) h - p.bottom else 0f
|
||||
@@ -195,14 +212,16 @@ class OnScreenControls(context: Context, private val pad: PadBridge) : View(cont
|
||||
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
for (control in controls) {
|
||||
if (!isVisible(control)) continue
|
||||
val held = control.pressedBy != -1
|
||||
val radius = controlRadius(control)
|
||||
if (control.stick >= 0) {
|
||||
// The base, then the knob where the finger holds it.
|
||||
fill.color = if (held) Color.argb(60, 199, 125, 255) else Color.argb(50, 20, 12, 30)
|
||||
canvas.drawCircle(control.cx, control.cy, control.radius, fill)
|
||||
canvas.drawCircle(control.cx, control.cy, radius, fill)
|
||||
stroke.color = if (held) Color.argb(200, 235, 212, 255) else Color.argb(90, 201, 160, 255)
|
||||
canvas.drawCircle(control.cx, control.cy, control.radius, stroke)
|
||||
val knob = control.radius * 0.46f
|
||||
canvas.drawCircle(control.cx, control.cy, radius, stroke)
|
||||
val knob = radius * 0.46f
|
||||
fill.color = if (held) Color.argb(170, 199, 125, 255) else Color.argb(110, 60, 40, 90)
|
||||
canvas.drawCircle(control.cx + control.kx, control.cy + control.ky, knob, fill)
|
||||
stroke.color = if (held) Color.argb(230, 245, 230, 255) else Color.argb(140, 201, 160, 255)
|
||||
@@ -213,12 +232,13 @@ class OnScreenControls(context: Context, private val pad: PadBridge) : View(cont
|
||||
continue
|
||||
}
|
||||
fill.color = if (held) Color.argb(150, 199, 125, 255) else Color.argb(70, 20, 12, 30)
|
||||
canvas.drawCircle(control.cx, control.cy, control.radius, fill)
|
||||
canvas.drawCircle(control.cx, control.cy, radius, fill)
|
||||
stroke.color = if (held) Color.argb(220, 235, 212, 255) else Color.argb(110, 201, 160, 255)
|
||||
canvas.drawCircle(control.cx, control.cy, control.radius, stroke)
|
||||
canvas.drawCircle(control.cx, control.cy, radius, stroke)
|
||||
text.color = if (held) Color.WHITE else Color.argb(190, 225, 210, 245)
|
||||
text.textSize = control.radius * 0.85f
|
||||
canvas.drawText(control.label, control.cx, control.cy + text.textSize * 0.35f, text)
|
||||
val label = if (buttonsOnly && control.id == "guide") "Steam" else control.label
|
||||
text.textSize = if (buttonsOnly && control.id == "guide") dp(11f) else radius * 0.85f
|
||||
canvas.drawText(label, control.cx, control.cy + text.textSize * 0.35f, text)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,18 +297,32 @@ class OnScreenControls(context: Context, private val pad: PadBridge) : View(cont
|
||||
return false
|
||||
}
|
||||
|
||||
private fun controlAt(x: Float, y: Float): Control? = controls.firstOrNull { it.contains(x, y) }
|
||||
private fun controlAt(x: Float, y: Float): Control? =
|
||||
controls.firstOrNull { isVisible(it) && it.contains(x, y, controlRadius(it)) }
|
||||
|
||||
private fun isVisible(control: Control): Boolean =
|
||||
!buttonsOnly || control.id == "guide" || control.id == "qam"
|
||||
|
||||
private fun controlRadius(control: Control): Float =
|
||||
if (buttonsOnly && (control.id == "guide" || control.id == "qam")) dp(30f) else control.radius
|
||||
|
||||
private fun apply() {
|
||||
pad.applyTouch { state ->
|
||||
for (control in controls) {
|
||||
val held = control.pressedBy != -1
|
||||
when {
|
||||
control.stick >= 0 && !control.dirty -> {}
|
||||
control.stick == 0 -> { state.thumbLX = control.kx / control.radius; state.thumbLY = control.ky / control.radius; control.dirty = false }
|
||||
control.stick == 1 -> { state.thumbRX = control.kx / control.radius; state.thumbRY = control.ky / control.radius; control.dirty = false }
|
||||
control.dpad >= 0 -> state.dpad[control.dpad] = held
|
||||
control.button >= 0 -> state.setPressed(control.button, held)
|
||||
if (buttonsOnly) {
|
||||
val guidePressed = controls.first { it.id == "guide" }.pressedBy != -1
|
||||
val qamPressed = controls.first { it.id == "qam" }.pressedBy != -1
|
||||
pad.setSystemButtons(guidePressed, qamPressed)
|
||||
} else {
|
||||
pad.setSystemButtons(false, false)
|
||||
pad.applyTouch { state ->
|
||||
for (control in controls) {
|
||||
val held = control.pressedBy != -1
|
||||
when {
|
||||
control.stick >= 0 && !control.dirty -> {}
|
||||
control.stick == 0 -> { state.thumbLX = control.kx / control.radius; state.thumbLY = control.ky / control.radius; control.dirty = false }
|
||||
control.stick == 1 -> { state.thumbRX = control.kx / control.radius; state.thumbRY = control.ky / control.radius; control.dirty = false }
|
||||
control.dpad >= 0 -> state.dpad[control.dpad] = held
|
||||
control.button >= 0 -> state.setPressed(control.button, held)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -297,7 +331,7 @@ class OnScreenControls(context: Context, private val pad: PadBridge) : View(cont
|
||||
|
||||
/** Everything up, for when the controls are hidden mid-press. */
|
||||
fun releaseAll() {
|
||||
if (controls.none { it.pressedBy != -1 }) return
|
||||
if (controls.none { it.pressedBy != -1 } && !buttonsOnly) return
|
||||
controls.forEach { it.pressedBy = -1; if (it.stick >= 0 && (it.kx != 0f || it.ky != 0f)) it.dirty = true; it.kx = 0f; it.ky = 0f }
|
||||
apply()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.steamdeck.launcher.input;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.view.InputDevice;
|
||||
import android.view.KeyEvent;
|
||||
@@ -24,10 +26,20 @@ public final class PadBridge {
|
||||
/** Slot 0 is the one the session exports; extra slots would each show as another pad. */
|
||||
private static final int SLOT = 0;
|
||||
private static final float DEAD_ZONE = 0.12f;
|
||||
private static final long QAM_GUIDE_LEAD_MS = 80;
|
||||
private static final long QAM_A_HOLD_MS = 120;
|
||||
private static final long QAM_GUIDE_TAIL_MS = 40;
|
||||
|
||||
private final FakeInputWriter writer;
|
||||
private final GamepadState state = new GamepadState();
|
||||
private final GamepadState effectiveState = new GamepadState();
|
||||
private final Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
private boolean open;
|
||||
private boolean systemGuidePressed;
|
||||
private boolean systemQamPressed;
|
||||
private boolean qamChordActive;
|
||||
private boolean qamSyntheticAPressed;
|
||||
private int qamChordGeneration;
|
||||
|
||||
public PadBridge(File fakeInputDir) {
|
||||
writer = new FakeInputWriter(fakeInputDir.getAbsolutePath(), SLOT);
|
||||
@@ -43,6 +55,11 @@ public final class PadBridge {
|
||||
}
|
||||
|
||||
public synchronized void stop() {
|
||||
systemGuidePressed = false;
|
||||
systemQamPressed = false;
|
||||
qamChordActive = false;
|
||||
qamSyntheticAPressed = false;
|
||||
qamChordGeneration++;
|
||||
if (open) {
|
||||
state.reset();
|
||||
writer.writeGamepadState(state);
|
||||
@@ -139,9 +156,61 @@ public final class PadBridge {
|
||||
publish();
|
||||
}
|
||||
|
||||
/** Touch-only Steam and QAM buttons, merged with physical input without changing its state. */
|
||||
public synchronized void setSystemButtons(boolean guidePressed, boolean qamPressed) {
|
||||
if (systemGuidePressed == guidePressed && systemQamPressed == qamPressed) return;
|
||||
boolean qamStarted = qamPressed && !systemQamPressed;
|
||||
systemGuidePressed = guidePressed;
|
||||
systemQamPressed = qamPressed;
|
||||
if (qamStarted) startQamChord();
|
||||
else publish();
|
||||
}
|
||||
|
||||
/** Starts the same Guide-then-A sequence used by the touch QAM button. */
|
||||
public synchronized void triggerQam() {
|
||||
startQamChord();
|
||||
}
|
||||
|
||||
private void startQamChord() {
|
||||
if (qamChordActive) return;
|
||||
qamChordActive = true;
|
||||
int generation = ++qamChordGeneration;
|
||||
publish();
|
||||
mainHandler.postDelayed(() -> pressQamA(generation), QAM_GUIDE_LEAD_MS);
|
||||
}
|
||||
|
||||
private synchronized void pressQamA(int generation) {
|
||||
if (generation != qamChordGeneration || !qamChordActive) return;
|
||||
qamSyntheticAPressed = true;
|
||||
publish();
|
||||
mainHandler.postDelayed(() -> releaseQamA(generation), QAM_A_HOLD_MS);
|
||||
}
|
||||
|
||||
private synchronized void releaseQamA(int generation) {
|
||||
if (generation != qamChordGeneration || !qamChordActive) return;
|
||||
qamSyntheticAPressed = false;
|
||||
publish();
|
||||
mainHandler.postDelayed(() -> releaseQamGuide(generation), QAM_GUIDE_TAIL_MS);
|
||||
}
|
||||
|
||||
private synchronized void releaseQamGuide(int generation) {
|
||||
if (generation != qamChordGeneration || !qamChordActive) return;
|
||||
qamChordActive = false;
|
||||
publish();
|
||||
}
|
||||
|
||||
private void publish() {
|
||||
if (!open && !start()) return;
|
||||
writer.writeGamepadState(state);
|
||||
if (systemGuidePressed || qamChordActive) {
|
||||
effectiveState.copy(state);
|
||||
effectiveState.setPressed(GamepadState.IDX_BUTTON_MODE, true);
|
||||
if (qamSyntheticAPressed) {
|
||||
effectiveState.setPressed(0, state.isPressed(0) || qamSyntheticAPressed);
|
||||
}
|
||||
writer.writeGamepadState(effectiveState);
|
||||
} else {
|
||||
writer.writeGamepadState(state);
|
||||
}
|
||||
}
|
||||
|
||||
private static float axis(MotionEvent event, int axis) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.content.Context
|
||||
object SessionPrefs {
|
||||
const val OSC_AUTO = "auto"
|
||||
const val OSC_ALWAYS = "always"
|
||||
const val OSC_STEAM_QAM = "steam-qam"
|
||||
const val OSC_NEVER = "never"
|
||||
|
||||
private fun prefs(context: Context) = context.getSharedPreferences("session", Context.MODE_PRIVATE)
|
||||
@@ -219,6 +220,13 @@ object SessionPrefs {
|
||||
prefs(context).edit().putString("fexPreset", id).apply()
|
||||
}
|
||||
|
||||
/** The app's colour theme (ui/Themes ids); Paper on black unless chosen otherwise. */
|
||||
fun theme(context: Context): String = prefs(context).getString("theme", "paper") ?: "paper"
|
||||
|
||||
fun setTheme(context: Context, id: String) {
|
||||
prefs(context).edit().putString("theme", id).apply()
|
||||
}
|
||||
|
||||
/** What a mode gets when nothing was chosen. */
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
fun defaultResolutionCap(mode: String): Int = 720
|
||||
|
||||
@@ -134,6 +134,8 @@ class FrontEndState(
|
||||
val lsfgReady: Boolean = false,
|
||||
/** A page shown in the pane instead of the selection ("settings:steam", "settings:lxqt", "performance"), or null. */
|
||||
val pageKey: String? = null,
|
||||
/** The colour theme in use (ui/Themes ids). */
|
||||
val theme: String = Themes.PAPER,
|
||||
)
|
||||
|
||||
class FrontEndActions(
|
||||
@@ -159,6 +161,7 @@ class FrontEndActions(
|
||||
val onCredits: () -> Unit,
|
||||
/** Leaves the page in the pane (back key, the rail, or the page's own Back). */
|
||||
val onPageBack: () -> Unit = {},
|
||||
val onTheme: (String) -> Unit = {},
|
||||
)
|
||||
|
||||
// ───────────────────────────── Motion ─────────────────────────────
|
||||
@@ -177,8 +180,6 @@ internal object Motion {
|
||||
if (scale == 0f) snap() else spring(damping, stiffness)
|
||||
}
|
||||
|
||||
private val Accent2 = Color(0xFF7B4DFF)
|
||||
private val Good = Color(0xFF7FD8A0)
|
||||
private val Shape10 = RoundedCornerShape(10.dp)
|
||||
private val Shape12 = RoundedCornerShape(12.dp)
|
||||
|
||||
@@ -242,12 +243,13 @@ private fun Modifier.shine(trigger: Boolean, strength: Float = 0.22f): Modifier
|
||||
@Composable
|
||||
fun FrontEndScreen(s: FrontEndState, a: FrontEndActions, page: (@Composable () -> Unit)? = null) {
|
||||
var selected by rememberSaveable { mutableStateOf("steam") }
|
||||
var openDesktop by rememberSaveable { mutableStateOf(true) }
|
||||
var openSteam by rememberSaveable { mutableStateOf(true) }
|
||||
// Every category starts folded when the app opens: three headers and their counts, and the
|
||||
// rail unfolds only what the user reaches for. (rememberSaveable keeps a fold across a
|
||||
// rotation, not across launches, which is the point.)
|
||||
var openDesktop by rememberSaveable { mutableStateOf(false) }
|
||||
var openSteam by rememberSaveable { mutableStateOf(false) }
|
||||
var openEmu by rememberSaveable { mutableStateOf("") }
|
||||
// Setup starts open only while there is setting up to do (no runtime yet); otherwise it is
|
||||
// folded so the rail is the library.
|
||||
var openSetup by rememberSaveable { mutableStateOf(!s.ready) }
|
||||
var openSetup by rememberSaveable { mutableStateOf(false) }
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val ctx = LocalContext.current
|
||||
BackHandler(enabled = s.pageKey != null && page != null) { a.onPageBack() }
|
||||
@@ -319,6 +321,7 @@ private fun Rail(
|
||||
) { RunningTile(lastRunning, a.onResume) }
|
||||
|
||||
// The rail's selection is one pill that glides between rows; the rows only recolour.
|
||||
val pal = LocalPalette.current
|
||||
var navOrigin by remember { mutableStateOf(Offset.Zero) }
|
||||
val positions = remember { mutableStateMapOf<String, Rect>() }
|
||||
Box(modifier = Modifier.fillMaxWidth().onGloballyPositioned { val o = it.positionInRoot(); if (o != navOrigin) navOrigin = o }) {
|
||||
@@ -334,9 +337,9 @@ private fun Rail(
|
||||
.offset { IntOffset(x.roundToInt(), y.roundToInt()) }
|
||||
.width(with(density) { w.toDp() }).height(with(density) { h.toDp() })
|
||||
.alpha(alpha)
|
||||
.graphicsLayer { shadowElevation = 6.dp.toPx(); shape = Shape10; clip = false; ambientShadowColor = colors.primary; spotShadowColor = colors.primary }
|
||||
.graphicsLayer { shadowElevation = 6.dp.toPx(); shape = Shape10; clip = false; ambientShadowColor = pal.signal; spotShadowColor = pal.signal }
|
||||
.clip(Shape10)
|
||||
.background(Brush.linearGradient(listOf(colors.primary, Accent2))),
|
||||
.background(Brush.linearGradient(listOf(colors.primary, pal.primary2))),
|
||||
)
|
||||
val register: (String, LayoutCoordinates) -> Unit = { key, c ->
|
||||
val o = c.positionInRoot(); val r = Rect(o.x, o.y, o.x + c.size.width, o.y + c.size.height)
|
||||
@@ -373,7 +376,7 @@ private fun Rail(
|
||||
val item: @Composable (String, String?, Int, String?, () -> Unit) -> Unit = { label, value, i, key, act ->
|
||||
NavItem(label, key ?: "x", key != null && selected == key, small = true, tiny = true, muted = true, value = value, i = i, register = register, unregister = unregister) { act() }
|
||||
}
|
||||
NavItem("Setup", "x", false, caret = openSetup, count = 9, onClick = onToggleSetup)
|
||||
NavItem("Setup", "x", false, caret = openSetup, count = 10, onClick = onToggleSetup)
|
||||
Sub(openSetup) {
|
||||
item("Files", null, 0, null, a.onFiles)
|
||||
item("Desktop & apps", null, 1, null, a.onApps)
|
||||
@@ -418,6 +421,12 @@ private fun Rail(
|
||||
s.available != null && s.available != s.installed -> "update"
|
||||
else -> "remove"
|
||||
}, 8, null, a.onRuntime)
|
||||
Box {
|
||||
item("Theme", Themes.byId(s.theme).label, 9, null) { menus.open = "theme" }
|
||||
AnchoredMenu(menus.open == "theme", onDismiss = { if (menus.open == "theme") menus.open = null }, title = "Theme", note = "The icon's three colours, dealt out three ways. Applies at once.") {
|
||||
for (t in Themes.all) MenuItem(t.label, checked = s.theme == t.id, detail = t.detail) { a.onTheme(t.id); menus.open = null }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -432,6 +441,7 @@ private fun Rail(
|
||||
@Composable
|
||||
private fun RunningTile(name: String, onResume: () -> Unit) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val src = remember { MutableInteractionSource() }
|
||||
val hot = src.collectIsFocusedAsState().value || src.collectIsHoveredAsState().value
|
||||
val shift by animateFloatAsState(if (hot) 3f else 0f, Motion.sp(0.6f), label = "runShift")
|
||||
@@ -442,14 +452,14 @@ private fun RunningTile(name: String, onResume: () -> Unit) {
|
||||
modifier = Modifier.fillMaxWidth().padding(bottom = 6.dp)
|
||||
.graphicsLayer { translationX = shift.dp.toPx() }
|
||||
.clip(Shape12)
|
||||
.background(Brush.linearGradient(listOf(colors.primary.copy(alpha = 0.22f), Accent2.copy(alpha = 0.10f))))
|
||||
.border(1.dp, colors.primary.copy(alpha = if (hot) 0.8f else 0.35f), Shape12)
|
||||
.background(Brush.linearGradient(listOf(pal.signal.copy(alpha = 0.22f), pal.signal.copy(alpha = 0.06f))))
|
||||
.border(1.dp, pal.signal.copy(alpha = if (hot) 0.8f else 0.35f), Shape12)
|
||||
.hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, onClick = onResume)
|
||||
.padding(horizontal = 10.dp, vertical = 9.dp),
|
||||
) {
|
||||
Box(modifier = Modifier.size(14.dp), contentAlignment = Alignment.Center) {
|
||||
Box(modifier = Modifier.size(14.dp).graphicsLayer { scaleX = ring; scaleY = ring; alpha = (1.6f - ring) / 1.2f }.border(1.5.dp, Good, CircleShape))
|
||||
Box(modifier = Modifier.size(7.dp).clip(CircleShape).background(Good))
|
||||
Box(modifier = Modifier.size(14.dp).graphicsLayer { scaleX = ring; scaleY = ring; alpha = (1.6f - ring) / 1.2f }.border(1.5.dp, pal.good, CircleShape))
|
||||
Box(modifier = Modifier.size(7.dp).clip(CircleShape).background(pal.good))
|
||||
}
|
||||
Spacer(Modifier.width(8.dp))
|
||||
Column(modifier = Modifier.weight(1f)) {
|
||||
@@ -462,6 +472,7 @@ private fun RunningTile(name: String, onResume: () -> Unit) {
|
||||
/** A sub-list that unfolds; its children stagger in through [NavItem]'s index. */
|
||||
@Composable
|
||||
private fun Sub(open: Boolean, content: @Composable () -> Unit) {
|
||||
val line = LocalPalette.current.line
|
||||
AnimatedVisibility(
|
||||
open,
|
||||
enter = expandVertically(Motion.tw(420)) + fadeIn(Motion.tw(300, 50)),
|
||||
@@ -469,7 +480,7 @@ private fun Sub(open: Boolean, content: @Composable () -> Unit) {
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier.padding(start = 16.dp).fillMaxWidth()
|
||||
.drawWithContent { drawContent(); drawRect(Color(0xFF26303C), size = size.copy(width = 1.dp.toPx())) }
|
||||
.drawWithContent { drawContent(); drawRect(line, size = size.copy(width = 1.dp.toPx())) }
|
||||
.padding(start = 8.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(1.dp),
|
||||
) { content() }
|
||||
@@ -489,7 +500,7 @@ private fun NavItem(
|
||||
val pressed by src.collectIsPressedAsState()
|
||||
val fg by animateColorAsState(if (current) colors.onPrimary else if (muted) colors.onSurfaceVariant else colors.onBackground, Motion.tw(280), label = "navFg")
|
||||
val sub by animateColorAsState(if (current) colors.onPrimary else colors.onSurfaceVariant, Motion.tw(280), label = "navSub")
|
||||
val ring by animateColorAsState(if (focused) colors.primary else Color.Transparent, Motion.tw(180), label = "navRing")
|
||||
val ring by animateColorAsState(if (focused) LocalPalette.current.signal else Color.Transparent, Motion.tw(180), label = "navRing")
|
||||
val scale by animateFloatAsState(if (pressed) 0.98f else 1f, Motion.sp(0.5f, Spring.StiffnessMedium), label = "navScale")
|
||||
val rot by animateFloatAsState(if (caret == true) 90f else 0f, Motion.sp(0.6f), label = "caret")
|
||||
if (key != "x") DisposableEffect(key) { onDispose { unregister?.invoke(key) } }
|
||||
@@ -516,7 +527,7 @@ private fun NavItem(
|
||||
if (value != null) Text(value, fontSize = 11.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||
if (count != null) Text(
|
||||
count.toString(), fontSize = 11.sp, color = sub,
|
||||
modifier = Modifier.clip(RoundedCornerShape(99.dp)).background(if (current) Color.White.copy(alpha = 0.28f) else colors.background).padding(horizontal = 7.dp, vertical = 2.dp),
|
||||
modifier = Modifier.clip(RoundedCornerShape(99.dp)).background(if (current) colors.onPrimary.copy(alpha = 0.16f) else colors.background).padding(horizontal = 7.dp, vertical = 2.dp),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -703,12 +714,12 @@ private class Tile(val title: String, val sub: String, val art: File?, val key:
|
||||
|
||||
@Composable
|
||||
internal fun Eyebrow(t: String) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val rule = remember { Animatable(0f) }
|
||||
LaunchedEffect(Unit) { rule.animateTo(1f, Motion.tw(600, 120)) }
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
Box(modifier = Modifier.width(18.dp).height(1.5.dp).graphicsLayer { scaleX = rule.value; transformOrigin = androidx.compose.ui.graphics.TransformOrigin(0f, 0.5f) }.background(colors.primary))
|
||||
Text(t.uppercase(), fontSize = 11.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 2.sp, color = colors.primary)
|
||||
Box(modifier = Modifier.width(18.dp).height(1.5.dp).graphicsLayer { scaleX = rule.value; transformOrigin = androidx.compose.ui.graphics.TransformOrigin(0f, 0.5f) }.background(pal.signal))
|
||||
Text(t.uppercase(), fontSize = 11.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 2.sp, color = pal.signal)
|
||||
}
|
||||
}
|
||||
@Composable internal fun Title(t: String) = Text(t, fontSize = 26.sp, fontWeight = FontWeight.Bold, color = MaterialTheme.colorScheme.onBackground, modifier = Modifier.padding(top = 4.dp, bottom = 4.dp))
|
||||
@@ -719,18 +730,19 @@ private fun SectionTitle(t: String, detail: String?) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp), modifier = Modifier.fillMaxWidth().padding(top = 16.dp, bottom = 8.dp)) {
|
||||
Text(t.uppercase(), fontSize = 11.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 2.sp, color = colors.onSurfaceVariant)
|
||||
if (detail != null) Text(detail, fontSize = 11.sp, color = colors.onBackground)
|
||||
Box(modifier = Modifier.weight(1f).height(1.dp).background(Color(0xFF26303C)))
|
||||
Box(modifier = Modifier.weight(1f).height(1.dp).background(LocalPalette.current.line))
|
||||
}
|
||||
}
|
||||
@Composable private fun Note(t: String) = Text(t, fontSize = 13.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.fillMaxWidth().clip(Shape12).background(MaterialTheme.colorScheme.surface).border(1.dp, Color(0xFF33404F), Shape12).padding(12.dp))
|
||||
@Composable private fun Note(t: String) = Text(t, fontSize = 13.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.fillMaxWidth().clip(Shape12).background(MaterialTheme.colorScheme.surface).border(1.dp, LocalPalette.current.line2, Shape12).padding(12.dp))
|
||||
@Composable private fun Actions(content: @Composable () -> Unit) = Row(horizontalArrangement = Arrangement.spacedBy(10.dp), verticalAlignment = Alignment.CenterVertically) { content() }
|
||||
|
||||
@Composable
|
||||
private fun Chip(t: String, ok: Boolean) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
Text(
|
||||
t, fontSize = 11.sp, color = if (ok) Good else colors.onSurfaceVariant,
|
||||
modifier = Modifier.clip(RoundedCornerShape(99.dp)).background(colors.surfaceVariant).border(1.dp, if (ok) Good.copy(alpha = 0.3f) else Color(0xFF26303C), RoundedCornerShape(99.dp)).padding(horizontal = 9.dp, vertical = 4.dp),
|
||||
t, fontSize = 11.sp, color = if (ok) pal.good else colors.onSurfaceVariant,
|
||||
modifier = Modifier.clip(RoundedCornerShape(99.dp)).background(colors.surfaceVariant).border(1.dp, if (ok) pal.good.copy(alpha = 0.3f) else pal.line, RoundedCornerShape(99.dp)).padding(horizontal = 9.dp, vertical = 4.dp),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -742,6 +754,7 @@ private fun rememberHot(src: MutableInteractionSource): Boolean = src.collectIsF
|
||||
@Composable
|
||||
private fun PrimaryButton(text: String, enabled: Boolean = true, onClick: () -> Unit) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val src = remember { MutableInteractionSource() }
|
||||
val hot = rememberHot(src) && enabled
|
||||
val pressed by src.collectIsPressedAsState()
|
||||
@@ -751,9 +764,9 @@ private fun PrimaryButton(text: String, enabled: Boolean = true, onClick: () ->
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||
modifier = Modifier
|
||||
.graphicsLayer { scaleX = scale; scaleY = scale; shadowElevation = if (enabled) lift.dp.toPx() else 0f; shape = Shape12; clip = false; ambientShadowColor = colors.primary; spotShadowColor = colors.primary }
|
||||
.graphicsLayer { scaleX = scale; scaleY = scale; shadowElevation = if (enabled) lift.dp.toPx() else 0f; shape = Shape12; clip = false; ambientShadowColor = pal.signal; spotShadowColor = pal.signal }
|
||||
.clip(Shape12)
|
||||
.background(if (enabled) Brush.linearGradient(listOf(colors.primary, Accent2)) else Brush.linearGradient(listOf(colors.surfaceVariant, colors.surfaceVariant)))
|
||||
.background(if (enabled) Brush.linearGradient(listOf(colors.primary, pal.primary2)) else Brush.linearGradient(listOf(colors.surfaceVariant, colors.surfaceVariant)))
|
||||
.shine(hot, 0.45f)
|
||||
.hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, enabled = enabled, onClick = onClick)
|
||||
.padding(horizontal = 18.dp, vertical = 11.dp),
|
||||
@@ -770,8 +783,9 @@ internal fun SecondaryButton(text: String, enabled: Boolean = true, onClick: ()
|
||||
val hot = rememberHot(src) && enabled
|
||||
val pressed by src.collectIsPressedAsState()
|
||||
val scale by animateFloatAsState(if (pressed) 0.955f else if (hot) 1.02f else 1f, Motion.sp(0.5f, Spring.StiffnessMedium), label = "secScale")
|
||||
val edge by animateColorAsState(if (hot) colors.primary else Color(0xFF33404F), Motion.tw(250), label = "secEdge")
|
||||
val fill by animateColorAsState(if (hot) colors.primary.copy(alpha = 0.14f) else Color.White.copy(alpha = 0.03f), Motion.tw(250), label = "secFill")
|
||||
val pal = LocalPalette.current
|
||||
val edge by animateColorAsState(if (hot) pal.signal else pal.line2, Motion.tw(250), label = "secEdge")
|
||||
val fill by animateColorAsState(if (hot) pal.signal.copy(alpha = 0.14f) else Color.White.copy(alpha = 0.03f), Motion.tw(250), label = "secFill")
|
||||
Box(
|
||||
modifier = Modifier.graphicsLayer { scaleX = scale; scaleY = scale }.clip(Shape12).background(fill).border(1.dp, edge, Shape12)
|
||||
.alpha(if (enabled) 1f else 0.5f)
|
||||
@@ -786,12 +800,13 @@ private fun Cog(onClick: () -> Unit) {
|
||||
val src = remember { MutableInteractionSource() }
|
||||
val hot = rememberHot(src)
|
||||
val rot by animateFloatAsState(if (hot) 90f else 0f, Motion.sp(0.55f), label = "cog")
|
||||
val edge by animateColorAsState(if (hot) colors.primary else Color(0xFF33404F), Motion.tw(250), label = "cogEdge")
|
||||
val pal = LocalPalette.current
|
||||
val edge by animateColorAsState(if (hot) pal.signal else pal.line2, Motion.tw(250), label = "cogEdge")
|
||||
Box(
|
||||
contentAlignment = Alignment.Center,
|
||||
modifier = Modifier.size(42.dp).clip(Shape12).background(Color.White.copy(alpha = 0.03f)).border(1.dp, edge, Shape12)
|
||||
.hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, onClick = onClick),
|
||||
) { Icon(Icons.Filled.Settings, "Settings", tint = if (hot) colors.primary else colors.onBackground, modifier = Modifier.size(18.dp).rotate(rot)) }
|
||||
) { Icon(Icons.Filled.Settings, "Settings", tint = if (hot) pal.signal else colors.onBackground, modifier = Modifier.size(18.dp).rotate(rot)) }
|
||||
}
|
||||
|
||||
@Composable
|
||||
@@ -838,10 +853,11 @@ private fun GameTile(t: Tile, wide: Boolean, square: Boolean, src: MutableIntera
|
||||
val scale by animateFloatAsState(if (pressed) 0.97f else if (hot) 1.04f else 1f, Motion.sp(0.55f, Spring.StiffnessMedium), label = "tileScale")
|
||||
val lift by animateFloatAsState(if (hot) -5f else 0f, Motion.sp(0.6f), label = "tileLift")
|
||||
val elev by animateFloatAsState(if (hot) 18f else 2f, Motion.tw(300), label = "tileElev")
|
||||
val ring by animateColorAsState(if (hot) colors.primary else Color.Transparent, Motion.tw(220), label = "tileRing")
|
||||
val pal = LocalPalette.current
|
||||
val ring by animateColorAsState(if (hot) pal.signal else Color.Transparent, Motion.tw(220), label = "tileRing")
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.graphicsLayer { scaleX = scale; scaleY = scale; translationY = lift.dp.toPx(); shadowElevation = elev.dp.toPx(); shape = Shape12; clip = false; ambientShadowColor = if (hot) colors.primary else Color.Black; spotShadowColor = if (hot) colors.primary else Color.Black; transformOrigin = androidx.compose.ui.graphics.TransformOrigin(0.5f, 0.9f) }
|
||||
.graphicsLayer { scaleX = scale; scaleY = scale; translationY = lift.dp.toPx(); shadowElevation = elev.dp.toPx(); shape = Shape12; clip = false; ambientShadowColor = if (hot) pal.signal else Color.Black; spotShadowColor = if (hot) pal.signal else Color.Black; transformOrigin = androidx.compose.ui.graphics.TransformOrigin(0.5f, 0.9f) }
|
||||
.clip(Shape12)
|
||||
.background(colors.surface)
|
||||
.border(1.5.dp, ring, Shape12)
|
||||
@@ -858,8 +874,8 @@ private fun GameTile(t: Tile, wide: Boolean, square: Boolean, src: MutableIntera
|
||||
) {
|
||||
Box(
|
||||
contentAlignment = Alignment.Center,
|
||||
modifier = Modifier.size(if (square) 26.dp else 32.dp).graphicsLayer { shadowElevation = 10.dp.toPx(); shape = CircleShape; clip = false; spotShadowColor = colors.primary }.clip(CircleShape).background(colors.primary),
|
||||
) { Text("▶", fontSize = if (square) 9.sp else 11.sp, color = colors.onPrimary, modifier = Modifier.padding(start = 2.dp)) }
|
||||
modifier = Modifier.size(if (square) 26.dp else 32.dp).graphicsLayer { shadowElevation = 10.dp.toPx(); shape = CircleShape; clip = false; spotShadowColor = pal.signal }.clip(CircleShape).background(pal.signal),
|
||||
) { Text("▶", fontSize = if (square) 9.sp else 11.sp, color = Color.White, modifier = Modifier.padding(start = 2.dp)) }
|
||||
}
|
||||
}
|
||||
Column(modifier = Modifier.padding(horizontal = 6.dp, vertical = 5.dp)) {
|
||||
|
||||
@@ -128,8 +128,13 @@ fun ModeSettingsPage(s: ModeSettings, a: ModeSettingsActions) {
|
||||
)
|
||||
if (steam && s.oscMode != null) ChoiceRow(
|
||||
host, "osc", "On-screen controls", "The virtual pad drawn over a game.",
|
||||
listOf("auto" to "Auto", "always" to "Always", "never" to "Never"), s.oscMode,
|
||||
note = "Auto shows it when no controller is attached.", onPick = a.onOsc,
|
||||
listOf(
|
||||
SessionPrefs.OSC_AUTO to "Auto",
|
||||
SessionPrefs.OSC_ALWAYS to "Always",
|
||||
SessionPrefs.OSC_STEAM_QAM to "Steam + QAM",
|
||||
SessionPrefs.OSC_NEVER to "Never",
|
||||
), s.oscMode,
|
||||
note = "Auto shows the full pad when no controller is attached. Steam + QAM shows only those two buttons.", onPick = a.onOsc,
|
||||
)
|
||||
}
|
||||
if (steam && s.fexPreset != null) SettingsGroup("Games") {
|
||||
|
||||
@@ -4,6 +4,7 @@ import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||
import androidx.compose.foundation.interaction.PressInteraction
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
@@ -24,6 +25,7 @@ import androidx.compose.material3.OutlinedButton
|
||||
import androidx.compose.material3.Switch
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
@@ -50,14 +52,19 @@ import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Brush
|
||||
import androidx.compose.ui.graphics.graphicsLayer
|
||||
import androidx.compose.ui.semantics.contentDescription
|
||||
import androidx.compose.ui.semantics.semantics
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import com.steamdeck.launcher.core.FexPreset
|
||||
import com.steamdeck.launcher.gpu.FrameGen
|
||||
import com.steamdeck.launcher.session.SessionPrefs
|
||||
import kotlinx.coroutines.flow.collect
|
||||
|
||||
/** A line of numbers in the top-right corner. It takes no touches: everything goes to the game. */
|
||||
@Composable
|
||||
@@ -127,6 +134,8 @@ class DrawerActions(
|
||||
val onKeyboard: () -> Unit,
|
||||
/** Sends the Guide button (the client's menu); null on the desktop, where there is none. */
|
||||
val onSteamMenu: (() -> Unit)?,
|
||||
/** Sends Guide + A to open Steam's Quick Access Menu; null on the desktop. */
|
||||
val onQam: (() -> Unit)?,
|
||||
val onProtons: () -> Unit,
|
||||
val onOsc: (String) -> Unit,
|
||||
val onTouch: (String) -> Unit,
|
||||
@@ -147,6 +156,7 @@ class DrawerActions(
|
||||
@Composable
|
||||
fun SessionDrawer(open: Boolean, a: DrawerActions) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val host = rememberMenuHost()
|
||||
val veil by animateFloatAsState(if (open) 1f else 0f, Motion.tw(260), label = "veil")
|
||||
if (open || veil > 0.01f) Box(
|
||||
@@ -163,20 +173,57 @@ fun SessionDrawer(open: Boolean, a: DrawerActions) {
|
||||
modifier = Modifier
|
||||
.fillMaxHeight()
|
||||
.width(340.dp)
|
||||
.background(Color(0xF7101418))
|
||||
.background(pal.background.copy(alpha = 0.97f))
|
||||
// The panel swallows its own touches so they do not close it.
|
||||
.clickable(interactionSource = remember { MutableInteractionSource() }, indication = null) {}
|
||||
.verticalScroll(rememberScrollState())
|
||||
.padding(horizontal = 14.dp, vertical = 16.dp),
|
||||
) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.padding(start = 4.dp, bottom = 6.dp)) {
|
||||
Box(modifier = Modifier.size(10.dp).clip(CircleShape).background(Brush.linearGradient(listOf(colors.primary, Color(0xFF7B4DFF)))))
|
||||
Box(modifier = Modifier.size(10.dp).clip(CircleShape).background(Brush.linearGradient(listOf(colors.primary, pal.primary2))))
|
||||
Spacer(Modifier.width(10.dp))
|
||||
Column {
|
||||
Text("SteamDeck", fontSize = 17.sp, fontWeight = FontWeight.Bold, color = colors.onBackground)
|
||||
Text(if (a.steam) "Steam session" else "Desktop session", fontSize = 11.sp, color = colors.onSurfaceVariant)
|
||||
}
|
||||
}
|
||||
if (a.onSteamMenu != null && a.onQam != null) {
|
||||
val qamInteraction = remember { MutableInteractionSource() }
|
||||
var qamStartedOnPress by remember { mutableStateOf(false) }
|
||||
LaunchedEffect(qamInteraction) {
|
||||
qamInteraction.interactions.collect { interaction ->
|
||||
if (interaction is PressInteraction.Press) {
|
||||
qamStartedOnPress = true
|
||||
host.open = null
|
||||
a.onQam.invoke()
|
||||
}
|
||||
}
|
||||
}
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||
modifier = Modifier.fillMaxWidth().padding(bottom = 12.dp),
|
||||
) {
|
||||
OutlinedButton(
|
||||
onClick = { host.open = null; a.onSteamMenu.invoke() },
|
||||
modifier = Modifier.weight(1f).height(48.dp),
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
) {
|
||||
Text("STEAM", fontSize = 13.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 0.5.sp)
|
||||
}
|
||||
OutlinedButton(
|
||||
onClick = {
|
||||
host.open = null
|
||||
if (!qamStartedOnPress) a.onQam.invoke()
|
||||
qamStartedOnPress = false
|
||||
},
|
||||
interactionSource = qamInteraction,
|
||||
modifier = Modifier.weight(1f).height(48.dp).semantics { contentDescription = "Open Quick Access Menu" },
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
) {
|
||||
Text("…", fontSize = 22.sp, fontWeight = FontWeight.SemiBold)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SettingsGroup("Now") {
|
||||
ToggleRow(host, "hud", "Performance HUD", "The frame counter in the corner.", a.hudOn, onChange = a.onHud)
|
||||
@@ -204,11 +251,10 @@ fun SessionDrawer(open: Boolean, a: DrawerActions) {
|
||||
)
|
||||
if (a.steam) ChoiceRow(
|
||||
host, "osc", "On-screen controls", "The virtual pad drawn over a game.",
|
||||
listOf(SessionPrefs.OSC_AUTO to "Auto", SessionPrefs.OSC_ALWAYS to "Always", SessionPrefs.OSC_NEVER to "Never"), a.oscMode,
|
||||
note = "Auto shows it when no controller is attached.", onPick = a.onOsc,
|
||||
listOf(SessionPrefs.OSC_AUTO to "Auto", SessionPrefs.OSC_ALWAYS to "Always", SessionPrefs.OSC_STEAM_QAM to "Steam + QAM", SessionPrefs.OSC_NEVER to "Never"), a.oscMode,
|
||||
note = "Auto shows the full pad when no controller is attached. Steam + QAM shows only those two buttons.", onPick = a.onOsc,
|
||||
)
|
||||
ActionRow("Keyboard", "The on-screen keyboard, for a field the client or a program is waiting on.", "Show") { host.open = null; a.onKeyboard() }
|
||||
if (a.onSteamMenu != null) ActionRow("Steam menu", "The Guide button: the client's own overlay, for a pad without one.", "Open ◉") { host.open = null; a.onSteamMenu.invoke() }
|
||||
}
|
||||
|
||||
SettingsGroup("Next session") {
|
||||
|
||||
@@ -72,8 +72,6 @@ import androidx.compose.ui.window.PopupProperties
|
||||
|
||||
private val RowShape = RoundedCornerShape(12.dp)
|
||||
private val GroupShape = RoundedCornerShape(14.dp)
|
||||
private val Line = Color(0xFF26303C)
|
||||
private val Line2 = Color(0xFF33404F)
|
||||
|
||||
/** Which row's menu is open on a page, so the page can dim and only one menu shows. */
|
||||
class MenuHost {
|
||||
@@ -108,6 +106,7 @@ fun AnchoredMenu(open: Boolean, onDismiss: () -> Unit, title: String? = null, no
|
||||
val gap = with(LocalDensity.current) { 6.dp.roundToPx() }
|
||||
val provider = remember(gap) { BelowEndProvider(gap) }
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
Popup(popupPositionProvider = provider, onDismissRequest = onDismiss, properties = PopupProperties(focusable = true)) {
|
||||
AnimatedVisibility(
|
||||
visibleState = state,
|
||||
@@ -120,8 +119,8 @@ fun AnchoredMenu(open: Boolean, onDismiss: () -> Unit, title: String? = null, no
|
||||
.widthIn(min = 220.dp, max = 340.dp)
|
||||
.shadow(24.dp, RowShape, ambientColor = Color.Black, spotColor = Color.Black)
|
||||
.clip(RowShape)
|
||||
.background(Color(0xF21E2530))
|
||||
.border(1.dp, colors.primary.copy(alpha = 0.22f), RowShape)
|
||||
.background(pal.surfaceVariant.copy(alpha = 0.95f))
|
||||
.border(1.dp, pal.signal.copy(alpha = 0.22f), RowShape)
|
||||
.padding(6.dp),
|
||||
) {
|
||||
if (title != null) Text(
|
||||
@@ -131,7 +130,7 @@ fun AnchoredMenu(open: Boolean, onDismiss: () -> Unit, title: String? = null, no
|
||||
content()
|
||||
if (note != null) {
|
||||
Spacer(Modifier.height(4.dp))
|
||||
Box(Modifier.fillMaxWidth().height(1.dp).background(Line))
|
||||
Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line))
|
||||
Text(note, fontSize = 11.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(horizontal = 10.dp, vertical = 6.dp))
|
||||
}
|
||||
}
|
||||
@@ -146,6 +145,7 @@ fun MenuItem(
|
||||
trailing: (@Composable () -> Unit)? = null, onClick: () -> Unit,
|
||||
) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val src = remember { MutableInteractionSource() }
|
||||
val hot = src.collectIsFocusedAsState().value || src.collectIsHoveredAsState().value
|
||||
val shift by animateFloatAsState(if (hot) 2f else 0f, Motion.sp(0.5f), label = "miShift")
|
||||
@@ -159,9 +159,9 @@ fun MenuItem(
|
||||
.hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, enabled = enabled, onClick = onClick)
|
||||
.padding(horizontal = 10.dp, vertical = 9.dp),
|
||||
) {
|
||||
Text("✓", fontSize = 12.sp, color = colors.primary, modifier = Modifier.width(18.dp).alpha(if (checked) 1f else 0f))
|
||||
Text("✓", fontSize = 12.sp, color = pal.signal, modifier = Modifier.width(18.dp).alpha(if (checked) 1f else 0f))
|
||||
Column(modifier = Modifier.weight(1f)) {
|
||||
Text(label, fontSize = 13.5.sp, color = if (checked) colors.primary else colors.onBackground, maxLines = 2, overflow = TextOverflow.Ellipsis)
|
||||
Text(label, fontSize = 13.5.sp, color = if (checked) pal.signal else colors.onBackground, maxLines = 2, overflow = TextOverflow.Ellipsis)
|
||||
if (detail != null) Text(detail, fontSize = 11.sp, color = colors.onSurfaceVariant, maxLines = 2, overflow = TextOverflow.Ellipsis)
|
||||
}
|
||||
if (trailing != null) { Spacer(Modifier.width(8.dp)); trailing() }
|
||||
@@ -174,7 +174,8 @@ fun ValueChip(text: String, open: Boolean, enabled: Boolean = true, onClick: ()
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val src = remember { MutableInteractionSource() }
|
||||
val hot = src.collectIsFocusedAsState().value || src.collectIsHoveredAsState().value
|
||||
val edge by animateColorAsState(if (open || hot) colors.primary else Line2, Motion.tw(200), label = "chipEdge")
|
||||
val pal = LocalPalette.current
|
||||
val edge by animateColorAsState(if (open || hot) pal.signal else pal.line2, Motion.tw(200), label = "chipEdge")
|
||||
val rot by animateFloatAsState(if (open) 180f else 0f, Motion.sp(0.6f), label = "chipCaret")
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.SpaceBetween,
|
||||
@@ -201,18 +202,20 @@ fun ValueChip(text: String, open: Boolean, enabled: Boolean = true, onClick: ()
|
||||
@Composable
|
||||
fun SettingsGroup(title: String, content: @Composable ColumnScope.() -> Unit) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp), modifier = Modifier.fillMaxWidth().padding(top = 16.dp, bottom = 6.dp)) {
|
||||
Text(title.uppercase(), fontSize = 11.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 2.sp, color = colors.onSurfaceVariant)
|
||||
Box(modifier = Modifier.weight(1f).height(1.dp).background(Line))
|
||||
Box(modifier = Modifier.weight(1f).height(1.dp).background(pal.line))
|
||||
}
|
||||
Column(modifier = Modifier.fillMaxWidth().clip(GroupShape).background(colors.surface).border(1.dp, Line, GroupShape)) { content() }
|
||||
Column(modifier = Modifier.fillMaxWidth().clip(GroupShape).background(colors.surface).border(1.dp, pal.line, GroupShape)) { content() }
|
||||
}
|
||||
|
||||
/** A row: label and hint on the left, whatever control on the right. */
|
||||
@Composable
|
||||
fun SettingsRow(label: String, hint: String?, highlighted: Boolean = false, control: @Composable () -> Unit) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val bg by animateColorAsState(if (highlighted) colors.primary.copy(alpha = 0.10f) else Color.Transparent, Motion.tw(200), label = "rowBg")
|
||||
val pal = LocalPalette.current
|
||||
val bg by animateColorAsState(if (highlighted) pal.signal.copy(alpha = 0.10f) else Color.Transparent, Motion.tw(200), label = "rowBg")
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier.fillMaxWidth().background(bg).padding(horizontal = 14.dp, vertical = 11.dp),
|
||||
@@ -223,7 +226,7 @@ fun SettingsRow(label: String, hint: String?, highlighted: Boolean = false, cont
|
||||
}
|
||||
control()
|
||||
}
|
||||
Box(Modifier.fillMaxWidth().height(1.dp).background(Line))
|
||||
Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line))
|
||||
}
|
||||
|
||||
/** A row whose value is one of a list: the chip opens the menu, a pick closes it. */
|
||||
|
||||
@@ -3,23 +3,71 @@ package com.steamdeck.launcher.ui
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.staticCompositionLocalOf
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import com.steamdeck.launcher.session.SessionPrefs
|
||||
|
||||
/** One dark scheme, the icon's purple as the accent. The app is never light. */
|
||||
private val Scheme = darkColorScheme(
|
||||
primary = Color(0xFFC77DFF),
|
||||
onPrimary = Color(0xFF1B0730),
|
||||
secondary = Color(0xFF8899A6),
|
||||
background = Color(0xFF101418),
|
||||
onBackground = Color(0xFFDDDDDD),
|
||||
surface = Color(0xFF151A22),
|
||||
onSurface = Color(0xFFDDDDDD),
|
||||
surfaceVariant = Color(0xFF1E2530),
|
||||
onSurfaceVariant = Color(0xFF8899A6),
|
||||
error = Color(0xFFFF8A80),
|
||||
/**
|
||||
* The app's colours, in the icon's three: black, white and its blue. Three ways to deal them
|
||||
* out, chosen under Setup › Theme. [primary] is what the selection pill and the Play button are
|
||||
* made of; [signal] is the small accent for rules, rings, dots and the eyebrow - the same colour
|
||||
* as [primary] in the blue themes, the blue itself in Paper, where the primary is white.
|
||||
*/
|
||||
class Palette(
|
||||
val id: String, val label: String, val detail: String,
|
||||
val background: Color, val surface: Color, val surfaceVariant: Color, val line: Color, val line2: Color,
|
||||
val onBackground: Color, val onSurfaceVariant: Color,
|
||||
val primary: Color, val primary2: Color, val onPrimary: Color, val signal: Color,
|
||||
val good: Color, val error: Color = Color(0xFFFF8A80),
|
||||
)
|
||||
|
||||
object Themes {
|
||||
const val PAPER = "paper"
|
||||
const val ICON_BLUE = "blue"
|
||||
const val ELECTRIC = "electric"
|
||||
|
||||
val all: List<Palette> = listOf(
|
||||
Palette(
|
||||
PAPER, "Paper on black", "White is the primary, the icon's blue is the signal for rules, rings and dots.",
|
||||
background = Color(0xFF000000), surface = Color(0xFF0F0F10), surfaceVariant = Color(0xFF191A1C), line = Color(0xFF262729), line2 = Color(0xFF343638),
|
||||
onBackground = Color(0xFFF9F9F9), onSurfaceVariant = Color(0xFF8E9196),
|
||||
primary = Color(0xFFF9F9F9), primary2 = Color(0xFFD9DADD), onPrimary = Color(0xFF000000), signal = Color(0xFF136CE0),
|
||||
good = Color(0xFF4CD37F),
|
||||
),
|
||||
Palette(
|
||||
ICON_BLUE, "Icon blue", "Black ground, white type, the blue for everything selected, focused or pressed.",
|
||||
background = Color(0xFF050608), surface = Color(0xFF0E1116), surfaceVariant = Color(0xFF161B23), line = Color(0xFF1F2630), line2 = Color(0xFF2A3340),
|
||||
onBackground = Color(0xFFF2F4F7), onSurfaceVariant = Color(0xFF8A93A0),
|
||||
primary = Color(0xFF136CE0), primary2 = Color(0xFF0B4FB0), onPrimary = Color(0xFFFFFFFF), signal = Color(0xFF136CE0),
|
||||
good = Color(0xFF4CD37F),
|
||||
),
|
||||
Palette(
|
||||
ELECTRIC, "Electric navy", "The blue brighter, on surfaces that lean navy instead of grey.",
|
||||
background = Color(0xFF070A10), surface = Color(0xFF0F1522), surfaceVariant = Color(0xFF16203A), line = Color(0xFF1E2A47), line2 = Color(0xFF2A3A5E),
|
||||
onBackground = Color(0xFFEEF3FF), onSurfaceVariant = Color(0xFF8B9AB8),
|
||||
primary = Color(0xFF2E86FF), primary2 = Color(0xFF136CE0), onPrimary = Color(0xFFFFFFFF), signal = Color(0xFF2E86FF),
|
||||
good = Color(0xFF4CD37F),
|
||||
),
|
||||
)
|
||||
|
||||
fun byId(id: String): Palette = all.firstOrNull { it.id == id } ?: all[0]
|
||||
}
|
||||
|
||||
val LocalPalette = staticCompositionLocalOf { Themes.byId(Themes.PAPER) }
|
||||
|
||||
/** The app's theme; with no [theme] given, the one saved in the preferences. The app is never light. */
|
||||
@Composable
|
||||
fun SteamDeckTheme(content: @Composable () -> Unit) {
|
||||
MaterialTheme(colorScheme = Scheme, content = content)
|
||||
fun SteamDeckTheme(theme: String? = null, content: @Composable () -> Unit) {
|
||||
val id = theme ?: SessionPrefs.theme(LocalContext.current)
|
||||
val p = Themes.byId(id)
|
||||
val scheme = darkColorScheme(
|
||||
primary = p.primary, onPrimary = p.onPrimary, secondary = p.onSurfaceVariant,
|
||||
background = p.background, onBackground = p.onBackground,
|
||||
surface = p.surface, onSurface = p.onBackground,
|
||||
surfaceVariant = p.surfaceVariant, onSurfaceVariant = p.onSurfaceVariant,
|
||||
error = p.error,
|
||||
)
|
||||
CompositionLocalProvider(LocalPalette provides p) { MaterialTheme(colorScheme = scheme, content = content) }
|
||||
}
|
||||
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 924 B |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 530 B |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 35 KiB |
@@ -0,0 +1,99 @@
|
||||
# Lineage audit — what in this repo is Winlator's, and what it would take to leave the lineage
|
||||
|
||||
Audited 2026-09-23 against Winlator upstream (brunodev85's commits in the Bannerlator history) with
|
||||
a text-similarity measure, not by trusting the comments. Everything below is verifiable with
|
||||
`git grep -i winlator` (54 lines in 26 files) and a `difflib` ratio against Bruno's originals.
|
||||
|
||||
## 0. The right cut: inherited from Winlator, or written fresh inside its forks
|
||||
|
||||
WinNative and Bannerlator are Winlator forks, so "from Bannerlator" does not by itself mean
|
||||
"Winlator's". What matters is whether a piece came down from Bruno's tree or was written new in
|
||||
the forks. Measured against Bruno's originals:
|
||||
|
||||
**Inherited from Winlator (through the forks):**
|
||||
- the five small app files in §1 (228 lines);
|
||||
- the **PulseAudio AAudio sink** in the runtime's audio bundle: Bannerlator's adaptive
|
||||
`module-aaudio-sink` is a fork of Bruno's and Tom Yan's (brunodev85/pulseaudio-android,
|
||||
LGPL-2.1) with adaptive buffer sizing added. It lives in `pulseaudio.tzst` and the `libpulse*`
|
||||
prebuilts, not in app code. This is the one inherited piece that does real work.
|
||||
|
||||
**Written fresh in the forks, not Winlator's:**
|
||||
- the Wayland compositor and its Vulkan present path (Bannerlator);
|
||||
- DirectAudio, both the Wine driver and the relay (Bannerlator);
|
||||
- Win-FG (Bannerlator, FSR3-derived) and LSFG Native (WinNative's port of lsfg-vk);
|
||||
- the gamescope runtime, the session shim and the fake-evdev layer (WinNative); the proot launch
|
||||
here measures 1.5 % against Winlator's launcher — proot is the shared idea, none of the code is;
|
||||
- the file manager, the front end, the settings, the session service (Bannerlator / this app).
|
||||
|
||||
## 1. App code that is measurably Winlator's
|
||||
|
||||
| File | Bruno's original | Shared text | Lines | What it is |
|
||||
|---|---|---|---|---|
|
||||
| `core/Callback.java` | `core/Callback.java` | 55 % | 6 | a one-method callback interface |
|
||||
| `core/EnvironmentComponent.java` | `xenvironment/EnvironmentComponent.java` | 51 % | 17 | start/stop base for the audio components |
|
||||
| `input/GamepadState.java` | `inputcontrols/GamepadState.java` | 33 % | 58 | six axis floats, a d-pad array, a button mask |
|
||||
| `core/EnvVars.java` | `core/EnvVars.java` | 21 % | 31 | KEY=VALUE list helper |
|
||||
| `core/ProcessHelper.java` | `core/ProcessHelper.java` | 21 % | 116 | spawn a process, drain its output |
|
||||
|
||||
Five files, 228 lines, none above 55 %. Everything else with a Winlator name on it measures under
|
||||
12 % against Bruno's text — i.e. the file name and a few field names survived, the code did not:
|
||||
|
||||
| File | Compared with | Shared text |
|
||||
|---|---|---|
|
||||
| `audio/PulseAudioComponent.java` | Bruno's PulseAudioComponent | 11 % |
|
||||
| `core/FileUtils.java` | Bruno's FileUtils | 9 % |
|
||||
| `core/TarZst.java` | Bruno's TarCompressorUtils | 8 % |
|
||||
| `input/PadBridge.java` | Bruno's ExternalController | 7 % |
|
||||
| `files/FileOps.kt` | Bruno's FileUtils | 4 % |
|
||||
| `core/DeviceReport.kt` | Bruno's GPUInformation | 2 % |
|
||||
| `input/EvdevKeys.java` | Bruno's XKeycode | 2 % |
|
||||
| `gpu/TurnipDriver.java` | AdrenotoolsManager (pipetto-crypto's, not Bruno's) | 7 % |
|
||||
|
||||
## 2. Things named after Winlator that are not Winlator's code
|
||||
|
||||
- **`app/src/main/cpp/winlator/`** — the directory name only. Inside: `lsfg/` (WinNative's port of
|
||||
lsfg-vk, credited to Eden / PancakeTAS), `winfg/` (Bannerlator's Win-FG, FSR3-derived, with its own
|
||||
LICENSE and FidelityFX notice), `VulkanRendererContext.h` (a Vulkan dispatch table struct from
|
||||
Bannerlator's renderer, first written by yaywoohoo in June 2026). Referenced by 6 lines in
|
||||
`cpp/CMakeLists.txt` and 8 in `waylandcomp/CMakeLists.txt`, plus 9 comment lines in the compositor.
|
||||
- **`scanout/ScanoutContext.h`** — Bannerlator's (The412Banner, June 2026). Log tag `Winlator_Scanout`.
|
||||
- **`VulkanRendererContext.h`** log tags `Winlator_Renderer`, `Winlator_Scanout`.
|
||||
- **`fakeinput_steam.cpp`** — Max's, from WinNative. Connects to an abstract socket named
|
||||
`winlator_vibration` for rumble. **Nothing in this app serves that socket** (the server was
|
||||
Winlator's WinHandler); the connect fails silently and rumble is dead code here.
|
||||
- **`winlator-contents`** — the name of the public catalog repo, in two URLs (`linuxfs.json`,
|
||||
`desktop.json`) and the README. A repo name, not code.
|
||||
- **File manager comments** mention a `/storage/emulated/0/Winlator/…` path as an example.
|
||||
- **`WAYLAND_RUNTIME.md`, `HDR_RECON.md`** — design notes carried from Bannerlator that describe
|
||||
Bannerlator's X11 renderer (`libwinlator.so`), which this app does not have.
|
||||
|
||||
## 3. Credits and prose
|
||||
|
||||
- `README.md` — "Lineage and licence" paragraph and the credits list name Winlator.
|
||||
- `ui/MainScreen.kt` — the credits dialog text (the rest of that file is dead code).
|
||||
- `docs/releases/0.1.0.md` … `0.1.5.md` — a Winlator credit line each (published release notes;
|
||||
history, leave as is).
|
||||
- `PROGRESS_LOG.md` — five mentions, all of the `winlator-contents` repo.
|
||||
|
||||
## 4. What it would take
|
||||
|
||||
**To stop using Winlator code at all** — rewrite the five files in §1 (228 lines, an afternoon):
|
||||
a callback interface, a start/stop base class, a pad state holder, an env list, a process spawner.
|
||||
None of them does anything Winlator-specific; they are the shapes any such app has. Then the one
|
||||
real piece: a **new AAudio sink module** for PulseAudio in place of the forked one — a few hundred
|
||||
lines of C against the PulseAudio 13 module API (a sink that pulls from PA's render loop into an
|
||||
AAudio stream, with the adaptive buffer logic Bannerlator added kept), rebuilt into the audio
|
||||
bundle by the existing build-pulseaudio workflow. A day or two, and the part most worth testing.
|
||||
|
||||
**To stop being named after it** — rename `cpp/winlator/` (to `framegen/`), fix the two CMake
|
||||
files, the log tags, the abstract-socket name (and remove the dead rumble client while at it), and
|
||||
the comments; drop the Bannerlator design notes that describe the X11 path this app never had.
|
||||
|
||||
**To take it out of the credits** — the README paragraph, the credits dialog, and the credit line
|
||||
in future release notes. Past notes stay as published.
|
||||
|
||||
**What does not change** — the licence. Everything here is GPL-3.0 and stays so: the runtime and the
|
||||
fake-evdev layer are Max's (WinNative, GPL-3.0), the compositor, frame generation, file manager
|
||||
and the session are Bannerlator's (GPL-3.0), lsfg-vk and FidelityFX carry their own notices. Leaving
|
||||
Winlator's lineage does not leave the GPL, and does not touch the runtime image, which is shared
|
||||
with Bannerlator by design.
|
||||
@@ -0,0 +1,132 @@
|
||||
# SteamDeck 0.1.5
|
||||
|
||||
**A new front end, settings that open where they are, the client's frames back on a flagship, a
|
||||
new icon and three themes in its colours, and the first pull requests from a second pair of
|
||||
hands.** Install it over 0.1.4; same key, same runtime, nothing to re-download.
|
||||
|
||||
---
|
||||
|
||||
## 🧭 The front end
|
||||
|
||||
The main screen is a rail and a pane. The rail lists what can be launched — **Steam** and its
|
||||
installed games, **Desktop** and its emulators and *their* games — and **Setup** under them, every
|
||||
category folded when the app opens so the rail is three headers and their counts. The pane shows
|
||||
the chosen thing with its launch button, its art, and a shelf of the rest. A session left in the
|
||||
background is the first thing on the rail, with a pulse, and tapping it goes back in.
|
||||
|
||||
It moves: the selection is one pill that glides between rows, lists unfold with their children
|
||||
staggering in, a page change cascades the new page in row by row over a blurred wash of its own
|
||||
art, tiles lift and shine under the pad, the launch button sweeps a sheen and squashes on press,
|
||||
and the session rises over the front end and sinks back. Every duration follows the system's
|
||||
animator scale, so "no animations" in developer options snaps all of it. ✅ Seen on a Pocket FIT
|
||||
and a Fold.
|
||||
|
||||
**Emulators launch from the rail, under gamescope, with their games.** The ROMs folder is scanned
|
||||
per system (one level of subfolders, PS3 game folders, RPCS3's own installed games by their
|
||||
PARAM.SFO with their icons), and each game launches straight in. ✅ God of War II HD booted in RPCS3
|
||||
from the rail, ~40 fps on the FIT — the first emulator game from the app. The desktop's own Steam
|
||||
launchers hand a game to the app's Steam session (⚠️ the hand-off itself is not yet proven).
|
||||
|
||||
## 🎛️ Settings without a pop-up
|
||||
|
||||
The cog's window and the Performance dialog are pages in the pane: one row per setting, its value
|
||||
in a chip, and a small faded menu that opens right under the chip. One menu at a time; the page
|
||||
dims while it is open; the back key, the rail and the page's own Back all leave it. **Steam** and
|
||||
**Desktop** each have a Settings entry in the rail that lights while its page shows. Frame
|
||||
generation, Session logs, Start offline and Theme open their menu right on their rail row.
|
||||
|
||||
The **session drawer** is the same rows and menus, sliding in from the right: Now (HUD, frame
|
||||
generation, touch, the virtual pad, keyboard, the client's menu) and Next session (display shape,
|
||||
FEX preset, compatibility tools), with Send to background and Stop at the end.
|
||||
|
||||
## 🎨 The icon, and themes in its colours
|
||||
|
||||
A new launcher icon (Kurt's), and the same mark in the rail and on the loading screen. Three
|
||||
themes under Setup › Theme, in the icon's black, white and blue: **Paper on black** (the default —
|
||||
white is the primary, the blue is the small signal for rules, rings and dots), **Icon blue**, and
|
||||
**Electric navy**. A change applies at once.
|
||||
|
||||
## ⚡ Run as a game, and the client's frames back
|
||||
|
||||
- The app is declared a **game** to Android, with a game-mode config that welcomes Performance
|
||||
mode and refuses the OS-side frame-rate cap and resolution downscaling — the interventions that
|
||||
make a regular flagship's Big Picture crawl while a gaming phone's does not. The session window
|
||||
asks for **sustained performance mode**, the panel's **fastest display mode** at its size, tells
|
||||
GameManager it is in gameplay, and opens an **ADPF hint session** over the compositor thread fed
|
||||
with each presented frame's interval. One `perf:` line in the session log says what took.
|
||||
- **The client's GPU process stops dying on its way up.** libpci picks its procfs backend because
|
||||
the app can read `/proc/bus/pci`, then dies on the devices file inside it, which Android denies;
|
||||
Chromium loads libpci in its GPU process, so after a few tries CEF drew the whole interface on
|
||||
the CPU. An empty file bound over that path at session start answers the scan truthfully.
|
||||
(WinNative, maxjivi05: 44 → 85 fps in the Big Picture library on a OnePlus 15.) ✅ Big Picture at
|
||||
117–118 fps on both panels of a 120 Hz Fold, Adreno 830.
|
||||
- **Client interface** switches on the Performance page: threaded GL, lazy descriptors and no GL
|
||||
error checks, all on by default; **Steam Deck mode** (`-steamdeck -steamos3`) off by default,
|
||||
since the client then expects Deck hardware. What is in effect is in the device report.
|
||||
- **720p by default** for the client and the desktop; a cap you chose still wins.
|
||||
- **FEXCore presets** for the x86 games the client launches, Bannerlator's table carried over:
|
||||
Stability, Compatibility, Intermediate, Performance, Performance + TSO, Extreme, Extreme + TSO,
|
||||
Extreme-gn, Denuvo. The default is FEX's own defaults, which is what every session ran on before.
|
||||
- The guest gets the device's **time zone** (the client's clock and logs were UTC).
|
||||
- A device without an Adreno GPU is told **before** the runtime download that a session would be
|
||||
sound over a black screen.
|
||||
- The app's own libraries are **16 KB-aligned** (Android 15 devices). ⚠️ Six prebuilt PulseAudio
|
||||
libraries are still 4 KB-only and need a rebuild.
|
||||
|
||||
## 🕹️ On-screen controls: sticks, and the bars
|
||||
|
||||
A **left and a right stick** beside the d-pad, a base and a knob that follows the finger, writing
|
||||
the pad's thumb axes the way a physical stick does. The controls **take the bars** beside or under
|
||||
the picture when the panel letterboxes it — a Fold's side bars, a square panel's bottom band —
|
||||
and only overlay the picture when there are none wide enough. ⚠️ Not yet tried in a game.
|
||||
|
||||
## 🤝 From Kurt (xXJSONDeruloXx)
|
||||
|
||||
- The **hardware Back button** reaches the app and opens the drawer instead of going into Steam
|
||||
as Select. ✅ Verified on an AYN Thor.
|
||||
- The **launcher icon**.
|
||||
- **Local build and deploy helpers**: a Docker build for the preload libraries, a local release
|
||||
build with signing, an ADB install helper.
|
||||
|
||||
Every pull request against main now builds by itself and gets one comment kept current: mergeable
|
||||
or the conflicting hunks, and a failed build's compiler errors. The README lists the contributors
|
||||
and a ledger of their pull requests that a workflow keeps.
|
||||
|
||||
## 🔧 Smaller
|
||||
|
||||
The file manager and the picker stay in landscape · a session's log folder goes with it when it
|
||||
ends and the next session gets its own · a replaced session's exit no longer ends the one that
|
||||
replaced it · the desktop page says "Linux desktop environment" · the Kotlin compiler's session
|
||||
files are ignored.
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ Carried over — still open
|
||||
|
||||
The desktop → Steam hand-off and the sticks are untested on a device. A stick click is not yet
|
||||
offered. VAC-protected games report insecure. Games that ship only a Linux build won't start.
|
||||
|
||||
## Credits
|
||||
|
||||
- **maxjivi05 (Max)** — the gamescope runtime this is built on, the sandbox shims, the controller
|
||||
work, the NetworkManager stand-in and the libpci fix, from WinNative.
|
||||
- **Kurt Himebauch (xXJSONDeruloXx)** — the launcher icon, the hardware Back fix, the local build
|
||||
helpers.
|
||||
- **The412Banner** — the app, the Wayland compositor, the runtime plumbing, the Steam session, the
|
||||
front end and the File Manager (from Bannerlator).
|
||||
- **Winlator (brunodev85)** — the audio stack, the gamepad model and the shape of a session.
|
||||
- **Vauzi (Vauzi-17/710)** — the Adreno 710/720/722 device entries the experimental driver carries.
|
||||
|
||||
Frame generation: **Win-FG** is built in; **LSFG** uses the shader chain from *your own copy* of
|
||||
Lossless Scaling, read on device and never redistributed, on groundwork from **lsfg-vk (PancakeTAS)**.
|
||||
|
||||
GPL-3.0. gamescope, Mesa, Turnip, Xwayland, labwc, LXQt, PulseAudio, proot and Arch Linux ARM are
|
||||
their own authors'. **Not affiliated with Valve** — Steam, Proton and Steam Deck are Valve's, and no
|
||||
Valve software is redistributed here: the client is fetched from Valve's own manifest on your device.
|
||||
|
||||
---
|
||||
|
||||
**APK** `SteamDeck-0.1.5.apk` — 21093959 bytes
|
||||
`sha256 85b4295431ddea6f35025959864f3fbb47ad238693e146405ac0fe6ae87504f1`
|
||||
versionCode 6, built from `d2f4a84` by [run 35813465422](https://github.com/The412Banner/SteamDeck/actions/runs/35813465422).
|
||||
Signed with the AOSP test key (v1 + v2 + v3), so it installs over 0.1.4 in place.
|
||||
@@ -10,4 +10,4 @@ android.useAndroidX=true
|
||||
android.nonTransitiveRClass=true
|
||||
# The NDK the compositor is built with. CI passes the one the runner has installed
|
||||
# (-PndkVersion=…); this is the fallback for a local build.
|
||||
ndkVersion=27.0.12077973
|
||||
ndkVersion=27.3.13750724
|
||||
@@ -0,0 +1,147 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
repo_root=$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
sdk_dir=${ANDROID_HOME:-${ANDROID_SDK_ROOT:-"${HOME}/Library/Android/sdk"}}
|
||||
java_dir=${JAVA_HOME:-"/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home"}
|
||||
image_name=${STEAMDECK_BUILD_IMAGE:-steamdeck-local-cross:24.04-v2}
|
||||
|
||||
if [[ ! -x "${sdk_dir}/platform-tools/adb" ]]; then
|
||||
echo "Android SDK not found at ${sdk_dir}; set ANDROID_HOME or ANDROID_SDK_ROOT." >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! -x "${java_dir}/bin/java" ]]; then
|
||||
echo "Java 17 not found at ${java_dir}; set JAVA_HOME." >&2
|
||||
exit 1
|
||||
fi
|
||||
if ! command -v docker >/dev/null 2>&1; then
|
||||
echo "Docker is required to cross-compile the glibc ARM64 preload libraries." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! docker image inspect "${image_name}" >/dev/null 2>&1; then
|
||||
docker build --platform linux/amd64 -t "${image_name}" \
|
||||
-f "${repo_root}/tools/local-cross.Dockerfile" "${repo_root}"
|
||||
fi
|
||||
|
||||
docker run --rm --platform linux/amd64 \
|
||||
--user "$(id -u):$(id -g)" \
|
||||
-v "${repo_root}:/src" -w /src "${image_name}" bash -lc '
|
||||
set -euo pipefail
|
||||
d=app/src/main/assets/linuxfs
|
||||
mkdir -p "$d"
|
||||
aarch64-linux-gnu-g++ -shared -fPIC -O2 -Wall -Wno-attributes -Wno-nonnull-compare \
|
||||
-pthread -std=c++17 -static-libstdc++ -static-libgcc \
|
||||
-o "$d/libfakeinput.so" app/src/main/cpp/fakeinput_steam.cpp -ldl
|
||||
aarch64-linux-gnu-strip --strip-unneeded "$d/libfakeinput.so"
|
||||
aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -pthread \
|
||||
-o "$d/libblsession.so" tools/linuxfs/preload/*.c -ldl
|
||||
aarch64-linux-gnu-strip --strip-unneeded "$d/libblsession.so"
|
||||
for script in tools/linuxfs/overlay/usr/local/bin/bannerlator-*; do
|
||||
install -Dm644 "$script" "$d/usr/local/bin/$(basename "$script")"
|
||||
done
|
||||
install -Dm644 tools/linuxfs/desktop/steamdeck-desktop "$d/usr/local/bin/steamdeck-desktop"
|
||||
install -Dm644 tools/linuxfs/desktop/autostart "$d/etc/xdg/labwc/autostart"
|
||||
install -Dm644 tools/linuxfs/desktop/rc.xml "$d/etc/xdg/labwc/rc.xml"
|
||||
install -Dm644 tools/linuxfs/desktop/panel.conf "$d/etc/xdg/lxqt/panel.conf"
|
||||
install -Dm644 tools/linuxfs/desktop/firefox-steamdeck.js \
|
||||
"$d/usr/lib/firefox/defaults/pref/steamdeck.js"
|
||||
|
||||
need=$(aarch64-linux-gnu-readelf -d "$d/libfakeinput.so" | sed -n "s/.*NEEDED.*\\[\\(.*\\)\\]/\\1/p")
|
||||
for bad in libstdc++.so.6 libgcc_s.so.1; do
|
||||
if printf "%s\\n" "$need" | grep -qx "$bad"; then
|
||||
echo "libfakeinput.so links $bad; the C++ runtime must stay static" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
syms() { aarch64-linux-gnu-readelf -Ws "$1" | awk '\''$4 == "FUNC" && $5 == "GLOBAL" {sub(/@.*/, "", $8); print $8}'\''; }
|
||||
fake=$(syms "$d/libfakeinput.so")
|
||||
for sym in open openat ioctl read close poll ppoll select stat fstat access scandir; do
|
||||
printf "%s\\n" "$fake" | grep -qx "$sym" || {
|
||||
echo "libfakeinput.so does not export $sym" >&2
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
session=$(syms "$d/libblsession.so")
|
||||
for sym in socket bind getsockname setsockopt statfs statvfs; do
|
||||
printf "%s\\n" "$session" | grep -qx "$sym" || {
|
||||
echo "libblsession.so does not export $sym" >&2
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
test -f "$d/usr/local/bin/bannerlator-session"
|
||||
test -f "$d/usr/local/bin/bannerlator-proton-extra"
|
||||
'
|
||||
|
||||
export ANDROID_HOME="${sdk_dir}"
|
||||
export ANDROID_SDK_ROOT="${sdk_dir}"
|
||||
export JAVA_HOME="${java_dir}"
|
||||
ndk_version=${STEAMDECK_NDK_VERSION:-}
|
||||
if [[ -z "${ndk_version}" ]]; then
|
||||
ndk_path=$(find "${sdk_dir}/ndk" -mindepth 1 -maxdepth 1 -type d -print | sort -V | tail -1)
|
||||
ndk_version=${ndk_path##*/}
|
||||
fi
|
||||
if [[ -z "${ndk_version}" || ! -d "${sdk_dir}/ndk/${ndk_version}" ]]; then
|
||||
echo "No Android NDK found under ${sdk_dir}/ndk; set STEAMDECK_NDK_VERSION." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "${repo_root}"
|
||||
./gradlew assembleRelease -PndkVersion="${ndk_version}"
|
||||
|
||||
apk="${repo_root}/app/build/outputs/apk/release/app-release.apk"
|
||||
build_tools=$(find "${sdk_dir}/build-tools" -mindepth 1 -maxdepth 1 -type d -print | sort -V | tail -1)
|
||||
if [[ ! -x "${build_tools}/zipalign" || ! -x "${build_tools}/apksigner" ]]; then
|
||||
echo "Android build-tools with zipalign/apksigner are required under ${sdk_dir}/build-tools." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
staging_dir=$(mktemp -d "${TMPDIR:-/tmp}/steamdeck-apk.XXXXXX")
|
||||
trap 'rm -rf -- "${staging_dir}"' EXIT
|
||||
"${build_tools}/zipalign" -p -f 4 "${apk}" "${staging_dir}/app-release.aligned.apk"
|
||||
"${build_tools}/apksigner" sign \
|
||||
--ks keystore/testkey.p12 --ks-type PKCS12 --ks-pass pass:android \
|
||||
--ks-key-alias testkey --key-pass pass:android \
|
||||
--v1-signing-enabled true --v2-signing-enabled true --v3-signing-enabled true \
|
||||
--out "${apk}" "${staging_dir}/app-release.aligned.apk"
|
||||
|
||||
signature_output=$("${build_tools}/apksigner" verify --min-sdk-version 21 --verbose --print-certs "${apk}")
|
||||
printf '%s\n' "${signature_output}"
|
||||
for scheme in \
|
||||
'Verified using v1 scheme (JAR signing): true' \
|
||||
'Verified using v2 scheme (APK Signature Scheme v2): true' \
|
||||
'Verified using v3 scheme (APK Signature Scheme v3): true'; do
|
||||
grep -qF "${scheme}" <<<"${signature_output}" || {
|
||||
echo "APK signature check failed: ${scheme}" >&2
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
grep -qF 'Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android' \
|
||||
<<<"${signature_output}"
|
||||
|
||||
docker run --rm --platform linux/amd64 -v "${repo_root}:/src:ro" -w /src "${image_name}" \
|
||||
bash -lc '
|
||||
set -euo pipefail
|
||||
apk=app/build/outputs/apk/release/app-release.apk
|
||||
work=$(mktemp -d)
|
||||
unzip -q "$apk" "lib/arm64-v8a/*" -d "$work"
|
||||
cd "$work/lib/arm64-v8a"
|
||||
system="libc.so libm.so libdl.so liblog.so libandroid.so libz.so libvulkan.so
|
||||
libGLESv2.so libEGL.so libnativewindow.so libjnigraphics.so libaaudio.so
|
||||
libOpenSLES.so libmediandk.so libcamera2ndk.so libsync.so libneuralnetworks.so"
|
||||
fail=0
|
||||
for so in *.so; do
|
||||
for need in $(readelf -d "$so" | sed -n "s/.*NEEDED.*\\[\\(.*\\)\\]/\\1/p"); do
|
||||
[ -f "$need" ] && continue
|
||||
case " $(echo $system) " in *" $need "*) continue ;; esac
|
||||
echo "missing: $so -> $need"
|
||||
fail=1
|
||||
done
|
||||
done
|
||||
[ "$fail" -eq 0 ]
|
||||
echo "every NEEDED resolves"
|
||||
'
|
||||
|
||||
printf 'APK: %s\n' "${apk}"
|
||||
printf 'SHA-256: '
|
||||
shasum -a 256 "${apk}" | awk '{print $1}'
|
||||
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
repo_root=$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
sdk_dir=${ANDROID_HOME:-${ANDROID_SDK_ROOT:-"${HOME}/Library/Android/sdk"}}
|
||||
adb_bin=${ADB:-${sdk_dir}/platform-tools/adb}
|
||||
apk=${1:-"${repo_root}/app/build/outputs/apk/release/app-release.apk"}
|
||||
|
||||
if [[ ! -x "${adb_bin}" ]]; then
|
||||
echo "adb not found at ${adb_bin}; set ADB or ANDROID_HOME." >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! -f "${apk}" ]]; then
|
||||
echo "APK not found at ${apk}; run tools/build_local.sh first." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -n "${ADB_SERIAL:-}" ]]; then
|
||||
serial=${ADB_SERIAL}
|
||||
else
|
||||
devices=$("${adb_bin}" devices | awk '$2 == "device" {print $1}')
|
||||
device_count=$(printf '%s\n' "${devices}" | sed '/^$/d' | wc -l | tr -d ' ')
|
||||
if [[ "${device_count}" == 0 ]]; then
|
||||
echo "No authorized Android device found. Connect one or set ADB_SERIAL." >&2
|
||||
exit 2
|
||||
fi
|
||||
if [[ "${device_count}" != 1 ]]; then
|
||||
echo "Multiple Android devices found; set ADB_SERIAL explicitly." >&2
|
||||
printf '%s\n' "${devices}" >&2
|
||||
exit 2
|
||||
fi
|
||||
serial=${devices}
|
||||
fi
|
||||
|
||||
"${adb_bin}" -s "${serial}" install -r --no-incremental "${apk}"
|
||||
installed_path=$("${adb_bin}" -s "${serial}" shell pm path com.steamdeck.launcher | tr -d '\r')
|
||||
printf 'Installed on %s: %s\n' "${serial}" "${installed_path}"
|
||||
@@ -0,0 +1,14 @@
|
||||
FROM ubuntu:24.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y \
|
||||
binutils \
|
||||
binutils-aarch64-linux-gnu \
|
||||
gcc-aarch64-linux-gnu \
|
||||
g++-aarch64-linux-gnu \
|
||||
unzip \
|
||||
&& mkdir -p /src
|
||||
|
||||
WORKDIR /src
|
||||