fix: detect running Flatpak Steam correctly

Request only application IDs from flatpak ps so running Steam instances match correctly. Fix client selection validation and cover detection with regression tests.

Refs aclist/dztui#478.
This commit is contained in:
Sylvain Girard committed 2026-10-08 15:58:51 +02:00
1 parent 01be1247b4
commit f748b09ba7
2 files changed
+61 -2

No files matched your search

+4 -2
View File
@@ -20,7 +20,7 @@ def is_steam_running(cmd: str) -> bool:
if has_cmd(STEAM_CMD) is False:
return False
return is_running(STEAM_CMD)
elif cmd == FLATPAK_RUN_CMD or FLATPAK_SANDBOX:
elif cmd in (FLATPAK_RUN_CMD, FLATPAK_SANDBOX):
return is_flatpak_steam_running()
else:
raise TypeError("Not a valid Steam client selection")
@@ -31,7 +31,9 @@ def is_steam_running(cmd: str) -> bool:
def is_flatpak_steam_running() -> bool:
if has_cmd(FLATPAK_CMD) is False:
return False
proc = subprocess.check_output([FLATPAK_CMD, "ps"], text=True)
proc = subprocess.check_output(
[FLATPAK_CMD, "ps", "--columns=application"], text=True
)
lines = proc.splitlines()
if FLATPAK_APPID in lines:
return True