Preserve screen effects profile when game restarts

This commit is contained in:
EnzoDLofi committed 2026-11-13 22:16:13 -04:00
1 parent 24a88c559e
commit afc44f03b8
1 file changed
+8 -1
@@ -1637,13 +1637,20 @@ class SessionService : Service() {
return@postDelayed
}
if (steamGameRunning(gameId)) {
Log.i(TAG, "game $gameId is running again; restarting its exit watcher")
watchGameExit(gameId, gen, token)
return@postDelayed
}
if (SteamGameProcess.running()) {
clearActiveScreenEffectsProfile(gameId, gen, token)
Log.i(TAG, "another Steam game is still running after $gameId; checking again")
returnAfterGame(gameId, gen, token)
return@postDelayed
}
clearActiveScreenEffectsProfile(gameId, gen, token)
val written = runCatching { File(LinuxRuntime.sessionRoot(this), "steam-stop").writeText("") }
.onFailure { Log.w(TAG, "could not ask the client to exit after game $gameId", it) }.isSuccess
if (!written) return@postDelayed