mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 21:06:09 +00:00
fix: clearing a game's compatibility tool in Steam keeps the Linux build (#1250)
This commit is contained in:
1 parent
093a986b88
commit
3eb0400df8
3 files changed
+83
-3
No files matched your search
@@ -561,6 +561,8 @@ class Helper:
|
||||
# "native" from earlier builds also lists dual-platform games nobody chose to run natively.
|
||||
prior_native = state.get("native_choices", ())
|
||||
native_choices = set(prior_native if isinstance(prior_native, (list, tuple, set)) else ())
|
||||
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])
|
||||
@@ -585,7 +587,7 @@ class Helper:
|
||||
for app in native_choices:
|
||||
current[app] = ""
|
||||
for app in set(native) - native_choices:
|
||||
if not current.get(app):
|
||||
if not current.get(app) and app not in picked:
|
||||
current.pop(app, None)
|
||||
else:
|
||||
for app in set(native) | native_choices:
|
||||
@@ -593,7 +595,8 @@ class Helper:
|
||||
# The client shows an explicit native choice as the tool it inherits, and writes config.vdf late.
|
||||
if raw_mapping[app] == "" or current.get(app) not in self.known:
|
||||
current[app] = raw_mapping[app]
|
||||
elif app in prior_auto or app in native_choices:
|
||||
elif app in prior_auto or app in native_choices or app in picked and (
|
||||
not current.get(app) or COMPAT["unrunnable"](current[app], runnable)):
|
||||
current[app] = ""
|
||||
elif not current.get(app):
|
||||
current.pop(app, None)
|
||||
@@ -608,7 +611,7 @@ 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"]}),
|
||||
tools=catalog, live=True)
|
||||
picked=COMPAT["picked_after"](current, changes), tools=catalog, live=True)
|
||||
state.pop("native", None)
|
||||
if waiting:
|
||||
state["pending"] = wanted
|
||||
|
||||
@@ -1042,6 +1042,16 @@ def plan_mapping(current, installed, runnable, default, auto, native=None, picks
|
||||
return changes, kept
|
||||
|
||||
|
||||
def picked_apps(state):
|
||||
picked = state.get("picked", ())
|
||||
return {app for app in picked if isinstance(app, str)} if isinstance(picked, list) else set()
|
||||
|
||||
|
||||
def picked_after(current, changes):
|
||||
return sorted(({app for app, tool in current.items() if tool} - set(changes) |
|
||||
{app for app, tool in changes.items() if tool}) - {"0"}, key=app_order)
|
||||
|
||||
|
||||
def followers(state, current):
|
||||
if "auto" in state:
|
||||
return state["auto"]
|
||||
@@ -1287,6 +1297,8 @@ def register_default(config_path, apps=(), protect=(), default=None, catalog=Non
|
||||
native = native_targets(steam_root, set(apps) | set(picks) | set(managed) | set(native_choices))
|
||||
if linux_tool != FEX_TOOL:
|
||||
native = {app: linux_tool if tool == FEX_TOOL else tool for app, tool in native.items()}
|
||||
for app in picked_apps(state) & set(native):
|
||||
current.setdefault(app, "")
|
||||
changes, auto = plan_mapping(
|
||||
current, apps, names, default, followers(state, current), native, picks,
|
||||
overrides, managed, native_choices)
|
||||
@@ -1297,6 +1309,7 @@ def register_default(config_path, apps=(), protect=(), default=None, catalog=Non
|
||||
write_changed(config_path, text)
|
||||
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.pop("native", None)
|
||||
state["tools"] = catalog
|
||||
state.setdefault("default", default)
|
||||
|
||||
Reference in new issue
Block a user