Keep a Proton choice unless the shared build needs the other platform

This commit is contained in:
maxjivi05 authored and MaxsTechReview committed 2026-10-24 21:13:58 -04:00
1 parent 5f0e6a8b7e
commit 82d8eb3b79
3 files changed
+14 -4

No files matched your search

+2 -1
View File
@@ -305,7 +305,8 @@ alone would then read as an installed client.
downloaded its version again (Left 4 Dead 2, 8.6 GB; hard links do not help, switching platform makes downloaded its version again (Left 4 Dead 2, 8.6 GB; hard links do not help, switching platform makes
Steam download depot 551 anyway). A shared game gets the tool its own client uses: `droiddeck-fex` Steam download depot 551 anyway). A shared game gets the tool its own client uses: `droiddeck-fex`
there becomes `droiddeck-direct` here and the other way round, a Proton build keeps its Proton. Only there becomes `droiddeck-direct` here and the other way round, a Proton build keeps its Proton. Only
automatic choices are replaced; a tool the user picked stays. an automatic choice that would switch the build is replaced; any other choice, including another
Proton, stays.
- **Updates and uninstall.** The newer manifest wins: an update made through a view is written back to - **Updates and uninstall.** The newer manifest wins: an update made through a view is written back to
the client that owns the game. Uninstalling a shared game removes it from that client only; its files the client that owns the game. Uninstalling a shared game removes it from that client only; its files
stay with the client that installed it (Steam does not delete through the link) and it stays hidden stay with the client that installed it (Steam does not delete through the link) and it stays hidden
@@ -11,6 +11,7 @@ NOT_GAMES = frozenset((
)) ))
TOOL_DIR = re.compile(r"(steam ?linux ?runtime.*|proton.*|steamworks shared|fex|steamvr)", re.I) TOOL_DIR = re.compile(r"(steam ?linux ?runtime.*|proton.*|steamworks shared|fex|steamvr)", re.I)
AUTOMATIC = ("", "droiddeck-direct", "droiddeck-fex", "droiddeck-proton-arm64", "droiddeck-proton-11-arm64") AUTOMATIC = ("", "droiddeck-direct", "droiddeck-fex", "droiddeck-proton-arm64", "droiddeck-proton-11-arm64")
LINUX_TOOLS = ("droiddeck-direct", "droiddeck-fex")
STATE = ".droiddeck-shared.json" STATE = ".droiddeck-shared.json"
LABELS = {"arm64": "ARM64 client games", "x86-64": "x86-64 client games"} LABELS = {"arm64": "ARM64 client games", "x86-64": "x86-64 client games"}
@@ -205,6 +206,8 @@ def set_tools(config, wanted):
name = name.group(1) if name else "" name = name.group(1) if name else ""
if name == tool or not (canonical(name) in map(canonical, AUTOMATIC) or name.startswith("proton_")): if name == tool or not (canonical(name) in map(canonical, AUTOMATIC) or name.startswith("proton_")):
continue continue
if name and (name in LINUX_TOOLS) == (tool in LINUX_TOOLS):
continue
inner = inner[:m.start()] + inner[m.end():] inner = inner[:m.start()] + inner[m.end():]
inner = ('\n\t\t\t\t\t"%s"\n\t\t\t\t\t{\n\t\t\t\t\t\t"name"\t\t"%s"\n\t\t\t\t\t\t"config"\t\t""\n' inner = ('\n\t\t\t\t\t"%s"\n\t\t\t\t\t{\n\t\t\t\t\t\t"name"\t\t"%s"\n\t\t\t\t\t\t"config"\t\t""\n'
'\t\t\t\t\t\t"priority"\t\t"250"\n\t\t\t\t\t}' % (app, tool)) + inner '\t\t\t\t\t\t"priority"\t\t"250"\n\t\t\t\t\t}' % (app, tool)) + inner
+9 -3
View File
@@ -75,11 +75,17 @@ class SteamShareTest(unittest.TestCase):
self.assertEqual(tools['413150'], 'droiddeck-direct') self.assertEqual(tools['413150'], 'droiddeck-direct')
self.assertEqual(tools['13210'], 'droiddeck-proton-a64') self.assertEqual(tools['13210'], 'droiddeck-proton-a64')
def test_an_automatic_x64_proton_is_replaced(self): def test_a_proton_pick_stays_when_the_other_client_uses_another_proton(self):
(self.x64 / 'config/config.vdf').write_text(CONFIG % mapping(_13210='droiddeck-proton-11-a64')) (self.x64 / 'config/config.vdf').write_text(CONFIG % mapping(_13210='droiddeck-proton-11-a64'))
(self.arm / 'config/config.vdf').write_text(CONFIG % mapping(_0='droiddeck-proton-arm64'))
self.run_share('x86-64') self.run_share('x86-64')
self.assertEqual(SHARE['entries']((self.x64 / 'config/config.vdf').read_text())['13210'], 'droiddeck-proton-a64') self.assertEqual(SHARE['entries']((self.x64 / 'config/config.vdf').read_text())['13210'], 'droiddeck-proton-11-a64')
def test_an_automatic_proton_gives_way_to_the_installed_linux_build(self):
self.install(self.x64, '550', 'Left 4 Dead 2')
(self.x64 / 'config/config.vdf').write_text(CONFIG % mapping(_550='droiddeck-direct'))
(self.arm / 'config/config.vdf').write_text(CONFIG % mapping(_0='droiddeck-proton-arm64', _550='droiddeck-proton-arm64'))
self.run_share('arm64')
self.assertEqual(SHARE['entries']((self.arm / 'config/config.vdf').read_text())['550'], 'droiddeck-fex')
def test_an_x64_proton_pick_reaches_the_arm64_client(self): def test_an_x64_proton_pick_reaches_the_arm64_client(self):
self.install(self.x64, '550', 'Left 4 Dead 2') self.install(self.x64, '550', 'Left 4 Dead 2')