From 663da2948c66b9de6ffa53c06e9fb719c593c787 Mon Sep 17 00:00:00 2001 From: The412Banner Date: Thu, 22 Oct 2026 22:12:20 +0000 Subject: [PATCH 1/3] fix(steam): the last change to a game's compatibility tool wins A game's tool can be chosen in DroidDeck (per-game Proton) and in Steam's game properties. When they disagreed, DroidDeck always put its own choice back: the live helper within a second of the change, and again at every session start. Resetting the game's DroidDeck profile made it worse - it saved "use the default" (null), which was then forced onto the game. A DroidDeck choice is now applied once, and the client's later pick stands: a pick of one of DroidDeck's Protons becomes the DroidDeck choice too, any other pick (FEX, a Steam Linux Runtime, clearing the forced tool) ends it. "Use the default" and a profile reset are applied once and then dropped, so the game follows the default like one DroidDeck never touched. What was applied is kept in state.json (games_applied); choices an earlier build already applied count as applied. games.json is rewritten only if the app did not replace it meanwhile. An x86-only Proton picked in Steam is still replaced, since it cannot start on the phone. --- .../usr/local/bin/droiddeck-steam-compat | 13 ++- .../overlay/usr/local/bin/steam-compatibility | 102 +++++++++++++++++- tools/tests/test_steam_compat_live.py | 82 ++++++++++++++ 3 files changed, 187 insertions(+), 10 deletions(-) diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-compat b/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-compat index 3972faa9b3..e751d1f95d 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-compat +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-compat @@ -583,9 +583,8 @@ class Helper: picked = COMPAT["picked_apps"](state) runnable = {t["name"].lower() for t in live} apps = sorted(set(installed) | set(picks) | set(prior_auto) | native_choices, key=COMPAT["app_order"]) - overrides = COMPAT["requested_games"]( - COMPAT["game_requests"](), catalog, [t["name"] for t in live]) - apps = sorted(set(apps) | set(overrides), key=COMPAT["app_order"]) + asked = [app for app, request in COMPAT["game_requests"]().items() if COMPAT["valid_game_request"](app, request)] + apps = sorted(set(apps) | set(asked), key=COMPAT["app_order"]) current = dict(page.compat("many(%s)" % json.dumps(apps)) or {}) refused = set(apps) - set(current) refused_native = native_choices & refused @@ -597,7 +596,6 @@ class Helper: if isinstance(state.get("auto"), dict): state["auto"] = prior_auto native_choices -= refused - overrides = {app: tool for app, tool in overrides.items() if app not in refused} current["0"] = top["selected"] native = COMPAT["native_targets"](self.steam_root, apps) raw_mapping = COMPAT["read_config_mapping"]( @@ -619,6 +617,10 @@ class Helper: current[app] = "" elif not current.get(app): current.pop(app, None) + # The client's pick of a tool the app chose for a game wins once the app's choice was applied. + requests = COMPAT["settled_game_requests"](state, current, catalog) + overrides = COMPAT["requested_games"](requests, catalog, [t["name"] for t in live]) + overrides = {app: tool for app, tool in overrides.items() if app not in refused} changes, auto = COMPAT["plan_mapping"]( current, installed, [t["name"] for t in live], default, COMPAT["followers"](state, current), native, picks, overrides, @@ -630,7 +632,8 @@ class Helper: state.update( auto={app: tool for app, tool in auto.items() if tool is not COMPAT["NATIVE_CHOICE"]}, native_choices=sorted(refused_native | {app for app, tool in auto.items() if tool is COMPAT["NATIVE_CHOICE"]}), - picked=COMPAT["picked_after"](current, changes), tools=catalog, live=True) + picked=COMPAT["picked_after"](current, changes), tools=catalog, live=True, + games_applied=COMPAT["applied_game_requests"](requests, overrides, state)) state.pop("native", None) if waiting: state["pending"] = wanted diff --git a/tools/linuxfs/overlay/usr/local/bin/steam-compatibility b/tools/linuxfs/overlay/usr/local/bin/steam-compatibility index 41a37a9aa5..055f33ede5 100755 --- a/tools/linuxfs/overlay/usr/local/bin/steam-compatibility +++ b/tools/linuxfs/overlay/usr/local/bin/steam-compatibility @@ -1113,10 +1113,99 @@ def requested_tool(request, catalog): def game_requests(directory=None): - value = read_json(state_path("games.json", directory)) - if value.get("version") != 1 or not isinstance(value.get("games"), dict): - return {} - return value["games"] + return read_game_requests(directory)[0] + + +def read_game_requests(directory=None): + """The app's per-game Proton choices, and the file's text so a rewrite can tell the app wrote it since.""" + try: + with open(state_path("games.json", directory), encoding="utf-8") as f: + text = f.read() + value = json.loads(text) + except (OSError, ValueError): + return {}, None + if not isinstance(value, dict) or value.get("version") != 1 or not isinstance(value.get("games"), dict): + return {}, text + return value["games"], text + + +def write_game_requests(requests, original, directory=None): + """Rewrites games.json unless the app replaced it after it was read; that newer choice wins.""" + path = state_path("games.json", directory) + try: + with open(path, encoding="utf-8") as f: + if f.read() != original: + return False + except OSError: + if original is not None: + return False + return write_json(path, {"version": 1, "games": requests}) + + +def valid_game_request(app, request): + return (isinstance(app, str) and re.fullmatch(r"[1-9][0-9]*", app) is not None and int(app) <= 0xFFFFFFFF and + (request is None or isinstance(request, dict) and isinstance(request.get("dir"), str) and + request["dir"] != "" and isinstance(request.get("valve"), bool))) + + +def settle_game_requests(requests, state, current, catalog, missing_is_cleared=False): + """Whichever side changed a game's tool last wins. A choice the app makes is applied once; after + that the client's own pick stands: a pick of one of our Protons becomes the app's choice too, any + other pick (FEX, a Steam Linux Runtime, clearing the forced tool) ends the app's choice. "Use the + default" (null, also what a profile reset writes) is applied once and then dropped, so the game + follows the default like one the app never touched. Returns the new requests and whether they changed.""" + recorded = state.get("games_applied") + if isinstance(recorded, dict): + applied = dict(recorded) + else: + # Builds before this one kept no record but had already applied every choice they found; a + # first start has applied nothing yet. + applied = dict(requests) if "tools" in state else {} + by_name = {t["name"]: t for t in catalog} + out = dict(requests) + for app, request in requests.items(): + if not valid_game_request(app, request) or app not in applied or applied[app] != request: + continue + if request is None: + del out[app] + continue + wanted = requested_tool(request, catalog) + if wanted is None: + continue + if app in current: + picked = current[app] + elif missing_is_cleared: + picked = "" + else: + continue + if picked == wanted: + continue + tool = by_name.get(picked) + if tool and tool["dir"]: + out[app] = {"valve": tool["valve"], "dir": tool["dir"]} + else: + del out[app] + return out, out != requests + + +def settled_game_requests(state, current, catalog, missing_is_cleared=False, directory=None): + """Reads the app's choices, settles them against the client's picks and stores the result. When the + app rewrote the file meanwhile, its newer choices are settled again; they are never overwritten.""" + for _ in range(2): + requests, text = read_game_requests(directory) + settled, moved = settle_game_requests(requests, state, current, catalog, missing_is_cleared) + if not moved or write_game_requests(settled, text, directory): + return settled + return settled + + +def applied_game_requests(requests, overrides, state): + """What the app asked for that is now in the mapping; a tool not installed yet stays unapplied.""" + recorded = state.get("games_applied") + before = recorded if isinstance(recorded, dict) else {} + return {app: request if overrides.get(app) is not DEFERRED_GAME_TOOL else before.get(app) + for app, request in requests.items() if app in overrides and + (overrides.get(app) is not DEFERRED_GAME_TOOL or app in before)} def requested_games(requests, catalog, runnable=None): @@ -1306,7 +1395,9 @@ def register_default(config_path, apps=(), protect=(), default=None, catalog=Non else: default = state.get("default") if state.get("default") in names else TOOL steam_root = os.path.dirname(os.path.dirname(os.path.abspath(config_path))) - overrides = requested_games(game_requests(directory), catalog) + # With the client stopped, config.vdf is what it last kept: an app missing from it has no forced tool. + requests = settled_game_requests(state, current, catalog, not steam_running(), directory) + overrides = requested_games(requests, catalog) managed = state.get("auto", {}).keys() if isinstance(state.get("auto"), dict) else () native_choices = state.get("native_choices", ()) native = native_targets(steam_root, set(apps) | set(picks) | set(managed) | set(native_choices)) @@ -1325,6 +1416,7 @@ def register_default(config_path, apps=(), protect=(), default=None, catalog=Non state["auto"] = {app: tool for app, tool in auto.items() if tool is not NATIVE_CHOICE} state["native_choices"] = sorted(app for app, tool in auto.items() if tool is NATIVE_CHOICE) state["picked"] = picked_after(current, changes) + state["games_applied"] = applied_game_requests(requests, overrides, state) state.pop("native", None) state["tools"] = catalog state.setdefault("default", default) diff --git a/tools/tests/test_steam_compat_live.py b/tools/tests/test_steam_compat_live.py index a86aab8644..5b793c313c 100644 --- a/tools/tests/test_steam_compat_live.py +++ b/tools/tests/test_steam_compat_live.py @@ -641,6 +641,88 @@ class ReconcileTest(unittest.TestCase): self.assertEqual(page.mapping["10"], "GE-Proton9-1") self.assertEqual(state["auto"], {"11": TOOL}) + def games(self): + return json.loads((self.state / "games.json").read_text())["games"] + + def write_games(self, games): + (self.state / "games.json").write_text(json.dumps({"version": 1, "games": games})) + + def test_a_steam_pick_after_the_app_choice_is_kept_live(self): + page = FakePage({"0": TOOL, "10": TOOL, "11": TOOL}, [TOOL, TOOL_11, COMPAT["FEX_TOOL"]]) + self.write_games({"10": {"valve": True, "dir": "Proton 11.0 (ARM64)"}}) + state = self.reconcile(page) + self.assertEqual(page.sets, [("10", TOOL_11)]) + self.assertEqual(state["games_applied"], {"10": {"valve": True, "dir": "Proton 11.0 (ARM64)"}}) + + page.sets.clear() + page.mapping["10"] = COMPAT["FEX_TOOL"] + state = self.reconcile(page) + self.assertEqual(page.sets, []) + self.assertEqual(page.mapping["10"], COMPAT["FEX_TOOL"]) + self.assertEqual(self.games(), {}) + self.assertEqual(state["games_applied"], {}) + + self.write_games({"10": {"valve": True, "dir": "Proton 11.0 (ARM64)"}}) + self.reconcile(page) + self.assertEqual(page.sets, [("10", TOOL_11)]) + + def test_a_steam_pick_of_our_proton_becomes_the_app_choice_live(self): + page = FakePage({"0": TOOL, "10": TOOL, "11": TOOL}, [TOOL, TOOL_11]) + self.write_games({"10": {"valve": True, "dir": "Proton 11.0 (ARM64)"}}) + self.reconcile(page) + page.sets.clear() + page.mapping["10"] = TOOL + state = self.reconcile(page) + self.assertEqual(page.sets, []) + self.assertEqual(self.games(), {"10": {"valve": True, "dir": "Proton Experimental (ARM64)"}}) + self.assertEqual(state["games_applied"], self.games()) + + def test_use_the_default_applies_once_then_steam_picks_stand_live(self): + page = FakePage({"0": TOOL, "10": TOOL_11, "11": TOOL}, [TOOL, TOOL_11, COMPAT["FEX_TOOL"]]) + self.write_games({"10": None}) + self.reconcile(page) + self.assertEqual(page.sets, [("10", TOOL)]) + + page.sets.clear() + self.reconcile(page) + self.assertEqual(self.games(), {}) + page.mapping["10"] = COMPAT["FEX_TOOL"] + self.reconcile(page) + self.assertEqual(page.sets, []) + self.assertEqual(page.mapping["10"], COMPAT["FEX_TOOL"]) + + def test_choices_an_earlier_build_applied_give_way_to_steam_picks_live(self): + (self.state / "state.json").write_text(json.dumps({"default": TOOL, "auto": {"11": TOOL}, "tools": []})) + self.write_games({"10": None, "11": {"valve": True, "dir": "Proton 11.0 (ARM64)"}}) + page = FakePage({"0": TOOL, "10": COMPAT["FEX_TOOL"], "11": "steamlinuxruntime_sniper"}, + [TOOL, TOOL_11, COMPAT["FEX_TOOL"]]) + self.reconcile(page) + self.assertEqual(page.sets, []) + self.assertEqual(self.games(), {}) + + def test_an_app_choice_written_during_a_sync_is_not_overwritten(self): + self.write_games({"10": {"valve": True, "dir": "Proton 11.0 (ARM64)"}}) + requests, text = COMPAT["read_game_requests"]() + self.write_games({"10": {"valve": True, "dir": "Proton Experimental (ARM64)"}}) + self.assertFalse(COMPAT["write_game_requests"]({}, text)) + self.assertEqual(self.games(), {"10": {"valve": True, "dir": "Proton Experimental (ARM64)"}}) + + def test_a_steam_pick_is_kept_at_the_next_start(self): + config = self.steam / "config/config.vdf" + config.parent.mkdir(parents=True) + vdf = '"InstallConfigStore" { "Software" { "Valve" { "Steam" { "CompatToolMapping" { %s } } } } }' + entry = '"%s" { "name" "%s" "config" "" "priority" "250" }' + catalog = COMPAT["tool_catalog"](str(self.steam)) + self.write_games({"10": {"valve": True, "dir": "Proton 11.0 (ARM64)"}}) + config.write_text(vdf % (entry % ("0", TOOL) + entry % ("10", TOOL))) + with mock.patch.dict(COMPAT["register_default"].__globals__, steam_running=lambda: False): + COMPAT["register_default"](str(config), ["10"], catalog=catalog, directory=str(self.state), settle=True) + self.assertIn(entry % ("10", TOOL_11), " ".join(config.read_text().split())) + config.write_text(vdf % (entry % ("0", TOOL) + entry % ("10", COMPAT["FEX_TOOL"]))) + COMPAT["register_default"](str(config), ["10"], catalog=catalog, directory=str(self.state), settle=True) + self.assertIn(entry % ("10", COMPAT["FEX_TOOL"]), " ".join(config.read_text().split())) + self.assertEqual(self.games(), {}) + def test_file_mode_defers_to_the_live_helper(self): (self.state / "live.pid").write_text("%d\n" % os.getpid()) self.assertTrue(COMPAT["live_helper_running"]()) From 449dc301bd1d9320824662568397cea6c0c9afca Mon Sep 17 00:00:00 2001 From: The412Banner Date: Thu, 22 Oct 2026 22:29:03 +0000 Subject: [PATCH 2/3] fix(steam): keep the applied record for a game the client did not report, and apply nothing after a lost write Review: a game the client briefly refused lost its games_applied record, so its unchanged request later looked new and overwrote the Steam pick; it now keeps what was applied before. When the app rewrote games.json during both tries, the stale second read was applied; that pass now applies no per-game choice and keeps the record. --- .../usr/local/bin/droiddeck-steam-compat | 2 +- .../overlay/usr/local/bin/steam-compatibility | 18 ++++++++----- tools/tests/test_steam_compat_live.py | 26 +++++++++++++++++++ 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-compat b/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-compat index e751d1f95d..2793365bc8 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-compat +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-compat @@ -619,7 +619,7 @@ class Helper: current.pop(app, None) # The client's pick of a tool the app chose for a game wins once the app's choice was applied. requests = COMPAT["settled_game_requests"](state, current, catalog) - overrides = COMPAT["requested_games"](requests, catalog, [t["name"] for t in live]) + overrides = COMPAT["requested_games"](requests or {}, catalog, [t["name"] for t in live]) overrides = {app: tool for app, tool in overrides.items() if app not in refused} changes, auto = COMPAT["plan_mapping"]( current, installed, [t["name"] for t in live], default, diff --git a/tools/linuxfs/overlay/usr/local/bin/steam-compatibility b/tools/linuxfs/overlay/usr/local/bin/steam-compatibility index 055f33ede5..69030a6b09 100755 --- a/tools/linuxfs/overlay/usr/local/bin/steam-compatibility +++ b/tools/linuxfs/overlay/usr/local/bin/steam-compatibility @@ -1190,22 +1190,26 @@ def settle_game_requests(requests, state, current, catalog, missing_is_cleared=F def settled_game_requests(state, current, catalog, missing_is_cleared=False, directory=None): """Reads the app's choices, settles them against the client's picks and stores the result. When the - app rewrote the file meanwhile, its newer choices are settled again; they are never overwritten.""" + app rewrote the file meanwhile, its newer choices are settled again; they are never overwritten. + None when the app kept rewriting it: this pass then applies no per-game choice and records nothing.""" for _ in range(2): requests, text = read_game_requests(directory) settled, moved = settle_game_requests(requests, state, current, catalog, missing_is_cleared) if not moved or write_game_requests(settled, text, directory): return settled - return settled + return None def applied_game_requests(requests, overrides, state): - """What the app asked for that is now in the mapping; a tool not installed yet stays unapplied.""" + """What the app asked for that is now in the mapping. A tool not installed yet stays unapplied, and a + game this pass did not handle (the client refused to report it) keeps what was applied before.""" recorded = state.get("games_applied") before = recorded if isinstance(recorded, dict) else {} - return {app: request if overrides.get(app) is not DEFERRED_GAME_TOOL else before.get(app) - for app, request in requests.items() if app in overrides and - (overrides.get(app) is not DEFERRED_GAME_TOOL or app in before)} + if requests is None: + return dict(before) + return {app: request if app in overrides and overrides[app] is not DEFERRED_GAME_TOOL else before[app] + for app, request in requests.items() + if app in overrides and overrides[app] is not DEFERRED_GAME_TOOL or app in before} def requested_games(requests, catalog, runnable=None): @@ -1397,7 +1401,7 @@ def register_default(config_path, apps=(), protect=(), default=None, catalog=Non steam_root = os.path.dirname(os.path.dirname(os.path.abspath(config_path))) # With the client stopped, config.vdf is what it last kept: an app missing from it has no forced tool. requests = settled_game_requests(state, current, catalog, not steam_running(), directory) - overrides = requested_games(requests, catalog) + overrides = requested_games(requests or {}, catalog) managed = state.get("auto", {}).keys() if isinstance(state.get("auto"), dict) else () native_choices = state.get("native_choices", ()) native = native_targets(steam_root, set(apps) | set(picks) | set(managed) | set(native_choices)) diff --git a/tools/tests/test_steam_compat_live.py b/tools/tests/test_steam_compat_live.py index 5b793c313c..af2d8cfb62 100644 --- a/tools/tests/test_steam_compat_live.py +++ b/tools/tests/test_steam_compat_live.py @@ -707,6 +707,32 @@ class ReconcileTest(unittest.TestCase): self.assertFalse(COMPAT["write_game_requests"]({}, text)) self.assertEqual(self.games(), {"10": {"valve": True, "dir": "Proton Experimental (ARM64)"}}) + def test_an_app_the_client_briefly_refuses_keeps_its_applied_choice_live(self): + page = FakePage({"0": TOOL, "10": TOOL, "11": TOOL}, [TOOL, TOOL_11, COMPAT["FEX_TOOL"]]) + self.write_games({"10": {"valve": True, "dir": "Proton 11.0 (ARM64)"}}) + self.reconcile(page) + page.refused = {"10"} + state = self.reconcile(page) + self.assertEqual(state["games_applied"], {"10": {"valve": True, "dir": "Proton 11.0 (ARM64)"}}) + page.refused = set() + page.sets.clear() + page.mapping["10"] = COMPAT["FEX_TOOL"] + self.reconcile(page) + self.assertEqual(page.sets, []) + self.assertEqual(page.mapping["10"], COMPAT["FEX_TOOL"]) + + def test_an_app_rewriting_its_choices_during_both_tries_applies_none_of_them_live(self): + page = FakePage({"0": TOOL, "10": TOOL, "11": TOOL}, [TOOL, TOOL_11, COMPAT["FEX_TOOL"]]) + self.write_games({"10": {"valve": True, "dir": "Proton 11.0 (ARM64)"}}) + self.reconcile(page) + page.sets.clear() + page.mapping["10"] = COMPAT["FEX_TOOL"] + self.write_games({"10": {"valve": True, "dir": "Proton 11.0 (ARM64)"}, "11": None}) + with mock.patch.dict(COMPAT["settled_game_requests"].__globals__, write_game_requests=lambda *_: False): + state = self.reconcile(page) + self.assertEqual(page.sets, []) + self.assertEqual(state["games_applied"], {"10": {"valve": True, "dir": "Proton 11.0 (ARM64)"}}) + def test_a_steam_pick_is_kept_at_the_next_start(self): config = self.steam / "config/config.vdf" config.parent.mkdir(parents=True) From 3e85e4a61410044b35c113339023ad81c8867774 Mon Sep 17 00:00:00 2001 From: maxjivi05 Date: Fri, 23 Oct 2026 15:51:06 -0400 Subject: [PATCH 3/3] chore: drop comments --- .../overlay/usr/local/bin/droiddeck-steam-compat | 1 - .../overlay/usr/local/bin/steam-compatibility | 15 --------------- 2 files changed, 16 deletions(-) diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-compat b/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-compat index 2793365bc8..1de4bcf1c9 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-compat +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-compat @@ -617,7 +617,6 @@ class Helper: current[app] = "" elif not current.get(app): current.pop(app, None) - # The client's pick of a tool the app chose for a game wins once the app's choice was applied. requests = COMPAT["settled_game_requests"](state, current, catalog) overrides = COMPAT["requested_games"](requests or {}, catalog, [t["name"] for t in live]) overrides = {app: tool for app, tool in overrides.items() if app not in refused} diff --git a/tools/linuxfs/overlay/usr/local/bin/steam-compatibility b/tools/linuxfs/overlay/usr/local/bin/steam-compatibility index 69030a6b09..29fe4f8e43 100755 --- a/tools/linuxfs/overlay/usr/local/bin/steam-compatibility +++ b/tools/linuxfs/overlay/usr/local/bin/steam-compatibility @@ -1117,7 +1117,6 @@ def game_requests(directory=None): def read_game_requests(directory=None): - """The app's per-game Proton choices, and the file's text so a rewrite can tell the app wrote it since.""" try: with open(state_path("games.json", directory), encoding="utf-8") as f: text = f.read() @@ -1130,7 +1129,6 @@ def read_game_requests(directory=None): def write_game_requests(requests, original, directory=None): - """Rewrites games.json unless the app replaced it after it was read; that newer choice wins.""" path = state_path("games.json", directory) try: with open(path, encoding="utf-8") as f: @@ -1149,17 +1147,10 @@ def valid_game_request(app, request): def settle_game_requests(requests, state, current, catalog, missing_is_cleared=False): - """Whichever side changed a game's tool last wins. A choice the app makes is applied once; after - that the client's own pick stands: a pick of one of our Protons becomes the app's choice too, any - other pick (FEX, a Steam Linux Runtime, clearing the forced tool) ends the app's choice. "Use the - default" (null, also what a profile reset writes) is applied once and then dropped, so the game - follows the default like one the app never touched. Returns the new requests and whether they changed.""" recorded = state.get("games_applied") if isinstance(recorded, dict): applied = dict(recorded) else: - # Builds before this one kept no record but had already applied every choice they found; a - # first start has applied nothing yet. applied = dict(requests) if "tools" in state else {} by_name = {t["name"]: t for t in catalog} out = dict(requests) @@ -1189,9 +1180,6 @@ def settle_game_requests(requests, state, current, catalog, missing_is_cleared=F def settled_game_requests(state, current, catalog, missing_is_cleared=False, directory=None): - """Reads the app's choices, settles them against the client's picks and stores the result. When the - app rewrote the file meanwhile, its newer choices are settled again; they are never overwritten. - None when the app kept rewriting it: this pass then applies no per-game choice and records nothing.""" for _ in range(2): requests, text = read_game_requests(directory) settled, moved = settle_game_requests(requests, state, current, catalog, missing_is_cleared) @@ -1201,8 +1189,6 @@ def settled_game_requests(state, current, catalog, missing_is_cleared=False, dir def applied_game_requests(requests, overrides, state): - """What the app asked for that is now in the mapping. A tool not installed yet stays unapplied, and a - game this pass did not handle (the client refused to report it) keeps what was applied before.""" recorded = state.get("games_applied") before = recorded if isinstance(recorded, dict) else {} if requests is None: @@ -1399,7 +1385,6 @@ def register_default(config_path, apps=(), protect=(), default=None, catalog=Non else: default = state.get("default") if state.get("default") in names else TOOL steam_root = os.path.dirname(os.path.dirname(os.path.abspath(config_path))) - # With the client stopped, config.vdf is what it last kept: an app missing from it has no forced tool. requests = settled_game_requests(state, current, catalog, not steam_running(), directory) overrides = requested_games(requests or {}, catalog) managed = state.get("auto", {}).keys() if isinstance(state.get("auto"), dict) else ()