fix(session): Steam's install-script step no longer counts as the game for return after game (#2732)

This commit is contained in:
The412Banner authored and GitHub committed 2026-11-18 09:37:50 -05:00
1 parent 1702f2d72d
commit 0a167e41c2
2 files changed
+22 -1

No files matched your search

@@ -40,8 +40,9 @@ object SteamGameProcess {
val appId = args.getOrNull(i + 1)
?.takeIf { it.startsWith("AppId=") }
?.removePrefix("AppId=")
val launchOptions = args.drop(i + 2).takeWhile { it != "--" }
if (appId == expectedAppId) return true
if (appId == expectedAppId && "Install=1" !in launchOptions) return true
}
if (args[i] == "-applaunch" &&
@@ -30,6 +30,22 @@ class SteamGameProcessTest {
assertFalse(SteamGameProcess.matches(cmdline("python3", "/proton", "waitforexitandrun", "game.exe"), "976310"))
}
@Test fun steamsInstallScriptStepIsNotTheGame() {
val wrapper = arrayOf("/root/.local/share/Steam/linuxarm64/steam-launch-wrapper", "--oom-score-adjust", "900", "--")
val reaper = "/root/.local/share/Steam/steamrtarm64/reaper"
val proton = "/root/.local/share/Steam/compatibilitytools.d/DroidDeck-Proton 11-12.8/droiddeck-proton-wrap"
val evaluator = arrayOf(reaper, "SteamLaunch", "AppId=351710", "Install=1", "--",
proton, "run", "/root/.local/share/Steam/legacycompat/iscriptevaluator.exe", "legacycompat\\evaluatorscript_351710.vdf")
val game = arrayOf(reaper, "SteamLaunch", "AppId=351710", "--",
proton, "waitforexitandrun", "/root/.local/share/Steam/steamapps/common/Neptunia Rebirth2/NeptuniaReBirth2.exe")
assertFalse(SteamGameProcess.matches(cmdline(*evaluator), "351710"))
assertFalse(SteamGameProcess.matches(cmdline(*wrapper, *evaluator), "351710"))
assertTrue(SteamGameProcess.matches(cmdline(*game), "351710"))
assertTrue(SteamGameProcess.matches(cmdline(*wrapper, *game), "351710"))
assertTrue(SteamGameProcess.matches(cmdline(reaper, "SteamLaunch", "AppId=351710", "--", "game", "Install=1"), "351710"))
}
@Test fun shortcutCGameIdsMatchTheir32BitSteamAppId() {
val cgameId = ((976310L shl 32) or 0x02000000L).toString()
@@ -67,5 +83,9 @@ class SteamGameProcessTest {
process("200", "reaper", "SteamLaunch", "AppId=976310", "--", "proton", "waitforexitandrun", "MK11.exe")
assertTrue(SteamGameProcess.running("976310", proc))
assertFalse(SteamGameProcess.running("123", proc))
process("300", "reaper", "SteamLaunch", "AppId=351710", "Install=1", "--", "proton", "run", "iscriptevaluator.exe")
assertFalse(SteamGameProcess.running("351710", proc))
process("301", "reaper", "SteamLaunch", "AppId=351710", "--", "proton", "waitforexitandrun", "game.exe")
assertTrue(SteamGameProcess.running("351710", proc))
}
}