diff --git a/tools/linuxfs/overlay/usr/local/bin/steam-compatibility b/tools/linuxfs/overlay/usr/local/bin/steam-compatibility index 6c861fcca..7dfc14f0d 100755 --- a/tools/linuxfs/overlay/usr/local/bin/steam-compatibility +++ b/tools/linuxfs/overlay/usr/local/bin/steam-compatibility @@ -1233,10 +1233,15 @@ def plan_mapping(current, installed, runnable, default, auto, native=None, picks for app in sorted((set(current) | installed | picks | set(auto) | set(overrides) | native_choices | set(tools)) - {"0"}, key=app_order): name = current.get(app, "") if app in tools and "linux" in tools[app]: - if "windows" in tools[app]: - if name and name == auto.get(app): + if "windows" not in tools[app]: + if name and (name.lower() in runnable or "proton" in name.lower()): changes[app] = None - elif name and (name.lower() in runnable or "proton" in name.lower()): + continue + if app in overrides: + target = overrides[app] + if target is not DEFERRED_GAME_TOOL and (target or None) != (name or None): + changes[app] = target or None + elif name and (name == auto.get(app) or unrunnable(name, runnable) or name.lower() in removed): changes[app] = None continue if app in overrides: diff --git a/tools/tests/test_steam_tool_platforms.py b/tools/tests/test_steam_tool_platforms.py index e2bb2218f..9f2bff7ce 100644 --- a/tools/tests/test_steam_tool_platforms.py +++ b/tools/tests/test_steam_tool_platforms.py @@ -105,6 +105,24 @@ class ToolPlatformsTest(unittest.TestCase): changes, auto = self.plan({"0": TOOL, "900007": name}, {"976730": TOOL}) self.assertNotIn("900007", changes) + def test_stale_tool_on_a_tool_with_a_linux_build_is_cleared(self): + self.add_launch_only_linux_tool() + for name, removed in (("GE-Proton11-7", ("GE-Proton11-7",)), ("proton_9", ())): + with self.subTest(name=name): + changes, auto = self.plan({"0": TOOL, "900007": name}, removed=removed) + self.assertIsNone(changes["900007"]) + self.assertNotIn("900007", auto) + + def test_explicit_request_on_a_tool_with_a_linux_build_is_applied(self): + self.add_launch_only_linux_tool() + changes, auto = self.plan({"0": TOOL}, overrides={"900007": TOOL}) + self.assertEqual(changes["900007"], TOOL) + changes, auto = self.plan({"0": TOOL, "900007": TOOL}, overrides={"900007": None}) + self.assertIsNone(changes["900007"]) + changes, auto = self.plan({"0": TOOL, "900007": TOOL}, overrides={"900007": TOOL}) + self.assertNotIn("900007", changes) + self.assertNotIn("900007", auto) + def test_removed_ge_proton_is_cleared_with_or_without_saved_ownership(self): for saved in ({}, {"1826330": "GE-Proton11-7"}): with self.subTest(saved=saved):