diff --git a/docs/steam-games.md b/docs/steam-games.md index 567bf02..8716e59 100644 --- a/docs/steam-games.md +++ b/docs/steam-games.md @@ -108,7 +108,8 @@ games, sideloaded titles, non-Steam shortcuts and Android apps. A game's library tile, a sideloaded title's ⋯ menu and the Control Center's **Force quit a game** card have **Force quit…** too. Each asks first ("Unsaved progress will be lost"); from a game's own menu it checks that the game is running and says so if -it isn't. +it isn't. SteamVR (app 250820, and its beta 1009850) is never listed or quit: +on the Frame it shows the headset view, so quitting it isn't a way out of a game. `ui/frame_running.py` does the work on the Frame, piped over SSH with `frame_steam.py` as its DevTools client: diff --git a/tests/test_force_quit.py b/tests/test_force_quit.py index add1498..aa30bc7 100644 --- a/tests/test_force_quit.py +++ b/tests/test_force_quit.py @@ -83,6 +83,15 @@ class Parsing(unittest.TestCase): procs[700] = proc(303, "reaper", [REAPER, "SteamLaunch", "AppId=777"], state="Z") self.assertEqual(frame_running.reapers(procs, ME), {620: [400], 999: [500]}) + def test_steamvr_is_never_a_game(self): + procs = frame() + procs[710] = proc(303, "reaper", [REAPER, "SteamLaunch", "AppId=250820", "--", "vrstartup"]) + procs[711] = proc(710, "vrcompositor-launcher") + self.assertNotIn(250820, frame_running.reapers(procs, ME)) + found = frame_running.running(procs, ME, steam=lambda ids: ([250820], {}), + android=dict, containers=set) + self.assertNotIn(250820, [a["appid"] for a in found]) + def test_gameid(self): self.assertEqual(frame_running.gameid(620), "620") # A non-Steam shortcut: (appid << 32) | 0x02000000, as steam_shortcuts.py stop sends. diff --git a/ui/frame_running.py b/ui/frame_running.py index 19e811f..718ee7b 100644 --- a/ui/frame_running.py +++ b/ui/frame_running.py @@ -46,6 +46,9 @@ PROTECTED = frozenset({ "pipewire", "pipewire-pulse", "wireplumber", "plasmashell", "kwin_wayland", "kwin_x11", "Xwayland", "sddm", "vrserver", "vrcompositor", "vrmonitor", "vrdashboard", "vrwebhelper", "vrstartup", }) +# Steam launches SteamVR under a reaper too, but on the Frame it's the headset's view, +# not a game: it's never listed or quit (SteamVR and SteamVR Beta). +NOT_GAMES = frozenset({250820, 1009850}) STEAM_WAIT = 5 # seconds for Steam's own terminate to end the game TERM_WAIT = 3 # then SIGTERM, and this long before SIGKILL KILL_WAIT = 2 @@ -108,7 +111,7 @@ def reapers(procs, uid): out = {} for pid, p in procs.items(): appid = launch_appid(p["argv"]) - if appid and p["uid"] == uid and p["state"] != "Z": + if appid and appid not in NOT_GAMES and p["uid"] == uid and p["state"] != "Z": out.setdefault(appid, []).append(pid) return out @@ -262,7 +265,8 @@ def running(procs=None, uid=None, steam=steam_view, android=android_apps, contai found.setdefault(int(m["shortcut"]), []) listed, names = steam(set(found)) for appid in listed or (): - found.setdefault(int(appid), []) + if int(appid) not in NOT_GAMES: + found.setdefault(int(appid), []) out = [] for appid, roots in sorted(found.items()): pids = tree(procs, roots, set())