Skip to content

Commit 2e6ed4d

Browse files
committed
Change default Proton versions
Previously we used stable Proton as the default Proton version in case no other configuration is found. This was changed to Proton Experimental in Steam client at some point. The default itself is hardcoded in one of the Steam client's shared libraries, meaning Protontricks cannot determine it programmatically. Instead, use Proton Experimental as the new default and fall back to the old default of stable Proton if Proton Experimental is not available. Fixes #435
1 parent ab0fb57 commit 2e6ed4d

File tree

3 files changed

+51
-34
lines changed

3 files changed

+51
-34
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
77
## [Unreleased]
88
### Fixed
99
- Fix Steam library folder discovery by using case-insensitive directory name matching
10+
- Fix default Proton version discovery. Protontricks will now use Proton Experimental as default per Steam client's hardcoded default setting, with stable Proton as fallback.
1011

1112
## [1.13.0] - 2025-08-11
1213
### Added

src/protontricks/steam.py

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -834,15 +834,18 @@ def _get_tool_app(compat_tool_name, steam_apps, steam_play_manifest):
834834
)
835835
potential_names.append(tool_name)
836836

837-
# Get the first name that was valid, or use stable Proton as fallback
837+
# Get the first name that was valid,
838+
# or use experimental or stable Proton as fallback
838839
try:
839-
compat_tool_name = next(name for name in potential_names if name)
840+
compat_tool_names = [
841+
next(name for name in potential_names if name)
842+
]
840843
except StopIteration:
841844
logger.info(
842845
"No compatibility tool found by reading Steam configuration. "
843-
"Using stable version of Proton as fallback."
846+
"Using Proton Experimental or stable Proton as fallback."
844847
)
845-
compat_tool_name = "proton-stable"
848+
compat_tool_names = ["proton-experimental", "proton-stable"]
846849

847850
# We've got a compatibility tool name,
848851
# now there are two possible ways to find the installation
@@ -852,30 +855,31 @@ def _get_tool_app(compat_tool_name, steam_apps, steam_play_manifest):
852855
# to parse a binary configuration file to find the App ID
853856

854857
# Let's try option 1 first
855-
try:
856-
app = next(
857-
app for app in steam_apps if app.name == compat_tool_name
858-
)
859-
logger.info(
860-
"Found active custom compatibility tool: %s", app.name
858+
for compat_tool_name in compat_tool_names:
859+
try:
860+
app = next(
861+
app for app in steam_apps if app.name == compat_tool_name
862+
)
863+
logger.info(
864+
"Found active custom compatibility tool: %s", app.name
865+
)
866+
return app
867+
except StopIteration:
868+
pass
869+
870+
# Try option 2:
871+
# Find the corresponding App ID from <steam_path>/appcache/appinfo.vdf
872+
tool_app = _get_tool_app(
873+
compat_tool_name=compat_tool_name,
874+
steam_apps=steam_apps,
875+
steam_play_manifest=steam_play_manifest
861876
)
862-
return app
863-
except StopIteration:
864-
pass
865-
866-
# Try option 2:
867-
# Find the corresponding App ID from <steam_path>/appcache/appinfo.vdf
868-
tool_app = _get_tool_app(
869-
compat_tool_name=compat_tool_name,
870-
steam_apps=steam_apps,
871-
steam_play_manifest=steam_play_manifest
872-
)
873877

874-
if tool_app:
875-
logger.info(
876-
"Found active compatibility tool: %s", tool_app.name
877-
)
878-
return tool_app
878+
if tool_app:
879+
logger.info(
880+
"Found active compatibility tool: %s", tool_app.name
881+
)
882+
return tool_app
879883

880884
logger.error("Could not find configured Proton installation!")
881885

tests/test_steam.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,24 @@ def test_find_steam_deck_profile(
333333
assert proton_app.name == "Proton 7.77"
334334

335335
@pytest.mark.usefixtures("info_logging")
336+
@pytest.mark.parametrize(
337+
"alias,name",
338+
[
339+
("proton-stable", "Proton 9.0"),
340+
("proton-experimental", "Proton Experimental")
341+
]
342+
)
336343
def test_find_steam_default_proton(
337-
self, steam_app_factory, steam_dir, default_proton,
338-
proton_factory, steam_config_path, caplog):
344+
self, steam_app_factory, steam_dir, proton_factory,
345+
steam_config_path, caplog, alias, name):
339346
"""
340-
Ensure the function returns the stable version of Proton if no
341-
other configuration is available
347+
Ensure the function returns the Proton Experimental or stable version
348+
of Proton if no other configuration is available
342349
"""
350+
proton_app = proton_factory(
351+
name=name, appid=20, compat_tool_name="proton-installation",
352+
aliases=[alias]
353+
)
343354
steam_app_factory(name="Fake game", appid=10)
344355

345356
# Clear the 'config.vdf' and remove any tool mappings, emulating
@@ -357,17 +368,18 @@ def test_find_steam_default_proton(
357368
})
358369
)
359370

360-
proton_app = find_steam_compat_tool_app(
371+
found_proton_app = find_steam_compat_tool_app(
361372
steam_path=steam_dir,
362-
steam_apps=[default_proton],
373+
steam_apps=[proton_app],
363374
appid=10
364375
)
365376

366-
assert proton_app.name == "Proton 4.20"
377+
assert found_proton_app.name == proton_app.name
367378

368379
assert any(
369380
record for record in caplog.records
370-
if "Using stable version of Proton" in record.message
381+
if "Using Proton Experimental or stable Proton as fallback"
382+
in record.message
371383
)
372384

373385
@pytest.mark.usefixtures("info_logging")

0 commit comments

Comments
 (0)