feat(steam): Play goes through the tile when Steam is up, so the Deck's controller is a controller #151
No reviewers
Labels
No labels
area/build
area/install
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!151
Loading…
Reference in a new issue
No description provided.
Delete branch "omgitsgela/LongshotLauncher:feat/play-through-steam-tile"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Status
Feature (fresh-install controller input), ready for review. Stacked on #130 (this forge will not take a cross-fork base, so the diff against main also carries #130's commits): review the last commit,
a4cf225, only. Merge #130 first and this PR's diff collapses to just the routing change.Why
On a fresh Deck, Steam Input only treats Longshot as a game when Steam launched it. Play from the launcher's own button starts the game direct, and under a running Steam the Deck's buttons then run Steam's default desktop layout — mouse and keyboard — which is the usual fresh-install complaint (the game's own
host/steam_pads.hdeliberately hides Steam's virtual gamepads and re-adds the physical one only under a realsteam_inputdevice, which exists only for Steam-launched games). So make Play go through Steam whenever that layer is available, and never touch global settings, controller configs, or sudo.What changes
Core/SteamLaunchRoute.cs(new): the decision. Linux + Steam up (SteamShortcuts.SteamUp, /proc scan) + our tile in its library (InLibrary) → hand offsteam://rungameid/<64-bit id>via xdg-open. That id rule —(unsigned appid << 32) | 0x02000000— is the sameGridId64this class already uses for capsule names, and it is verified working on the Deck by steam-for-linux#8580 (2026-03 workaround) and SteamTinkerLaunch#1117. Steam not up → direct (no Steam Input layer exists to want). No tile yet → direct with a toast naming the reason. Refused URI → direct. Windows → direct.App/LauncherService.cs(PlayFolder): ask the route after the saves/settings prep, fall back to the sameGamePlay.StartInfolaunch as before.SteamGameIdin the environment means this launcher itself arrived through the tile — start direct; (2) a one-shot handoff token (<home>/play-handoff, armed at handoff, consumed by the launched launcher, 2-minute ttl, cleared on a refused handoff) makes a second handoff impossible by construction — the delegated review was right that SteamGameId is not a delivery guarantee (Steam or the AppImage type-2 runtime could lose it; the runtime source doesexecvand preserves the environment, but the token does not depend on that).--playarrives throughPlayWithoutWindow, which runs before the instance lock is taken, so the routed instance never fights the open window's lock and never pokes it; the window keeps its claim exactly as before this feature (an earlier shape of this commit released the lock — the review's P1 — this does not).Testing
python3 -I tests/test_launcher_core.py --dotnet ~/dotnet/dotnet: 1458 checks passed (11 new inRouteChecks: routed URI names the tile'sGridId64; SteamGameId → direct, no second URI; no tile → direct + reason; Steam down → direct, nothing asked; refused URI → direct; Windows → direct; token armed by the handoff, consumed by the launch, one handoff per Play with SteamGameId absent; stale token ignored; refused handoff clears its token).python3 -I tests/test_release.py: OK. The reviewer independently confirmed--playis handled beforeTakeLock()(their Program.cs:56 reading), that the type-2 runtime preserves the environment (execv, noclearenv), and found no double-gather hazard (GatherSavesreturns immediately on Linux;SettingsCarry.Fillidempotent).Not tested: a live handoff on the Deck's own desktop mode — this was written against the launcher's unit harness; the Deck's Game Mode tile path (the tile itself → Steam Input) is measured and machine-proven on #130.
Must be tested: Deck desktop mode (Test Farm: @Beanstalk steamdeck): launcher Play with Steam running → game runs as a game (buttons pad, not mouse); with Steam quit → still starts direct; the note appears when there is no tile.
Risks
xdg-open is best-effort: refused or absent → the previous direct launch. The 64-bit id rule comes from community issue threads, not Valve docs; it agrees with our own grid-id rule measured against a real Deck library, and a wrong id only means Steam declines and the direct fallback runs.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.