mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 13:55:58 +00:00
Feat: Add per game screens effects (#2472)
* Add per-game screen effects profiles
* Fix stale screen effects callbacks
* Fix per-game screen effects profile handling
* Fix screen effects restoration on cancelled launch
* Allow nullable screen effects profile in drawer
* Fix per-game screen effects initialization
* Fix per-game screen effects tracking
* Tighten Steam process detection tests
* Fix per-game screen effects profile resolution
* Fix per-game screen effects profile selection
* Fix screen effects cleanup on game exit
* Fix Steam closing between game launches
* Update SessionService.kt comments removed
* Fix screen effects profile synchronization
* Fix saving screen effects without profile
* Prevent stale screen effects overwriting active profile
* Refresh screen effects on session resume
* Update SessionActivity.kt ( used rabbit suggested fixed )
* Fix Steam game exit detection and return
* Clear screen effects profile while awaiting Steam exit
* Preserve screen effects profile when game restarts
* Refactor screen effects sync and fix game exit handling
* Fix Steam URL game ID fallback
* Add screen effects translations for all locales
* Add per-game screen effects profiles
* Fix per-game screen effects preset persistence
* Fix screen effects profile upscaler handling
* Fix screen effects profile synchronization
* Fix screen effects focus profile synchronization
* Fix screen effects profile restoration on resume
* Fix screen effects profile switching
* Fix Steam game launch rollback target
* Fix screen effects upscaler profile inheritance
* Update SessionActivity.kt ( removed coments )
* Remove unused setup stores translations
* Guard screen effects profile rollback
* Fix per-game screen effects and queued launches
* Fix queued game state and suspend-aware startup timeout
* Fix integer scaling picture bounds
* Fix nullable automatic screen effects profile validation
* Fix integer scaling fallback for small outputs
* Revert "Fix integer scaling fallback for small outputs"
This reverts commit c667a50d58.
* Fix Steam game exit watcher for direct launches
* Fix per-game screen effects resume handling
* Fix game picture bounds scaling
This commit is contained in:
1 parent
ae9bac225d
commit
9ce6d45be8
41 files changed
+845
-89
No files matched your search
@@ -13,17 +13,46 @@ class SteamGameProcessTest {
|
||||
private fun cmdline(vararg args: String) = args.joinToString("\u0000", postfix = "\u0000").toByteArray()
|
||||
|
||||
@Test fun theSessionsOwnSearchesAreNotAGame() {
|
||||
assertFalse(SteamGameProcess.matches(cmdline("pgrep", "-a", "-f", "SteamLaunch AppId=[0-9]")))
|
||||
assertFalse(SteamGameProcess.matches(cmdline("pgrep", "-f", "reaper SteamLaunch")))
|
||||
assertFalse(SteamGameProcess.matches(cmdline("pgrep", "-f", "reaper SteamLaunch AppId=976310( |$)")))
|
||||
assertFalse(SteamGameProcess.matches(cmdline("sh", "-c", "pgrep -f 'proton waitforexitandrun'")))
|
||||
assertFalse(SteamGameProcess.matches(cmdline("/usr/bin/steam", "steam://rungameid/976310")))
|
||||
assertFalse(SteamGameProcess.matches(cmdline("pgrep", "-a", "-f", "SteamLaunch AppId=[0-9]"), "976310"))
|
||||
assertFalse(SteamGameProcess.matches(cmdline("pgrep", "-f", "reaper SteamLaunch"), "976310"))
|
||||
assertFalse(SteamGameProcess.matches(cmdline("pgrep", "-f", "reaper SteamLaunch AppId=976310( |$)"), "976310"))
|
||||
assertFalse(SteamGameProcess.matches(cmdline("sh", "-c", "pgrep -f 'proton waitforexitandrun'"), "976310"))
|
||||
assertFalse(SteamGameProcess.matches(cmdline("/usr/bin/steam", "steam://rungameid/976310"), "976310"))
|
||||
assertFalse(SteamGameProcess.matches(cmdline("reaper", "SteamLaunch", "AppId=976310"), ""))
|
||||
assertFalse(SteamGameProcess.matches(cmdline("reaper", "SteamLaunch", "AppId=976310"), "abc"))
|
||||
}
|
||||
|
||||
@Test fun steamsReaperAndProtonAreAGame() {
|
||||
assertTrue(SteamGameProcess.matches(cmdline("/root/.local/share/Steam/steamrtarm64/reaper", "SteamLaunch", "AppId=976310", "--",
|
||||
"/root/.local/share/Steam/compatibilitytools.d/droiddeck-proton-arm64/proton", "waitforexitandrun", "MK11.exe")))
|
||||
assertTrue(SteamGameProcess.matches(cmdline("python3", "/proton", "waitforexitandrun", "game.exe")))
|
||||
"/root/.local/share/Steam/compatibilitytools.d/droiddeck-proton-arm64/proton", "waitforexitandrun", "MK11.exe"), "976310"))
|
||||
assertFalse(SteamGameProcess.matches(cmdline("/root/.local/share/Steam/steamrtarm64/reaper", "SteamLaunch", "AppId=976310", "--",
|
||||
"/root/.local/share/Steam/compatibilitytools.d/droiddeck-proton-arm64/proton", "waitforexitandrun", "MK11.exe"), "123"))
|
||||
assertFalse(SteamGameProcess.matches(cmdline("python3", "/proton", "waitforexitandrun", "game.exe"), "976310"))
|
||||
}
|
||||
|
||||
@Test fun shortcutCGameIdsMatchTheir32BitSteamAppId() {
|
||||
val cgameId = ((976310L shl 32) or 0x02000000L).toString()
|
||||
|
||||
assertTrue(
|
||||
SteamGameProcess.matches(
|
||||
cmdline("reaper", "SteamLaunch", "AppId=976310", "--", "proton", "waitforexitandrun", "game.exe"),
|
||||
cgameId,
|
||||
)
|
||||
)
|
||||
|
||||
assertTrue(
|
||||
SteamGameProcess.matches(
|
||||
cmdline("steam", "-applaunch", "976310"),
|
||||
cgameId,
|
||||
)
|
||||
)
|
||||
|
||||
assertFalse(
|
||||
SteamGameProcess.matches(
|
||||
cmdline("reaper", "SteamLaunch", "AppId=123", "--", "proton", "waitforexitandrun", "game.exe"),
|
||||
cgameId,
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@Test fun runningLooksAtEveryProcess() {
|
||||
@@ -31,8 +60,12 @@ class SteamGameProcessTest {
|
||||
fun process(pid: String, vararg args: String) = File(proc, pid).apply { mkdirs() }.resolve("cmdline").writeBytes(cmdline(*args))
|
||||
process("100", "pgrep", "-a", "-f", "SteamLaunch AppId=[0-9]")
|
||||
process("self", "reaper", "SteamLaunch", "AppId=1")
|
||||
assertFalse(SteamGameProcess.running(proc))
|
||||
assertFalse(SteamGameProcess.running("976310", proc))
|
||||
assertFalse(SteamGameProcess.running("1", proc))
|
||||
process("101", "reaper", "SteamLaunch", "AppId=1")
|
||||
assertTrue(SteamGameProcess.running("1", proc))
|
||||
process("200", "reaper", "SteamLaunch", "AppId=976310", "--", "proton", "waitforexitandrun", "MK11.exe")
|
||||
assertTrue(SteamGameProcess.running(proc))
|
||||
assertTrue(SteamGameProcess.running("976310", proc))
|
||||
assertFalse(SteamGameProcess.running("123", proc))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user