Skip to content

fix(backend): a game's Retina in every prefix, and a stale launch wrapper replaced - #819

Merged
aaf2tbz merged 1 commit into
mainfrom
fix/per-game-retina-shared-prefix
Nov 20, 2026
Merged

aaf2tbz merged 1 commit into
mainfrom
fix/per-game-retina-shared-prefix

Conversation

@aaf2tbz

@aaf2tbz aaf2tbz commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #811, for the reporter's latest comment. #812 fixed the FEX switch itself. The reporter then described games in the Sharp Library that didn't pick up Retina, "stuck on Wine virtual display", capped at 60 FPS on D3DMetal and Mullion. It happened per game, and reinstalling fixed it. I found two bugs that match: one breaks per-game Retina, the other only clears with a reinstall.

  1. A game's own Retina setting reached only bottles/<id> prefixes.
    • A Windows program with no bottle of its own runs in Steam's prefix, so the "High resolution (Retina)" choice its Game settings show was silently ignored.
    • When a game did change Steam's prefix, the value stayed for every Steam game after it until Steam's next start.
    • Now each launch sets its own value (the game's choice, or Settings > Graphics') in whatever prefix it starts in. It imports only when user.reg doesn't already hold it.
  2. The Wine launch wrapper (cache/metalsharp-wine-game-launcher) went stale.
    • It was written once with O_EXCL. If an earlier MetalSharp's wrapper was there instead, it was refused and launches went without it.
    • A game's window mode and resolution were then dropped until a reinstall wiped cache/.
    • It's now replaced atomically with this MetalSharp's wrapper.

On the other point in that comment: the same failure going the other way (FEX first, then switching to x86_64) is also covered by #812. ms_wine_x86_64_app_source() reads the app version through the same popen/pclose, and the reaper that broke it is gone.

Changes

  • game_tuning.c: apply_bottle_retina is now apply_prefix_retina and applies to any prefix. The "a prefix Wine hasn't made starts with Retina off" shortcut is kept.
  • steam_actions.c: ms_steam_wine_launch_wrapper_path keeps a matching wrapper. Otherwise it writes to a temporary file and renames it over the old one.
  • Tests:
    • game_tuning_test.c, using a fake wine that logs the import:
      • a Windows program's Retina On is imported into prefix-steam
      • nothing is imported again once user.reg holds it
      • the next Steam game with no setting of its own puts Settings > Graphics' value back
    • runtime_routes_test.c: a wrapper from an earlier MetalSharp is replaced, keeps the same path, and stays executable.

PR Readiness (MANDATORY)

  • Real-game launch test completed for game/runtime/graphics/compatibility changes: not done. I couldn't confirm that the 60 FPS cap comes from Wine's virtual desktop.
  • No hardcoded paths, secrets, or absolute /Users/... paths introduced
  • Config/rules TOML validated: N/A
  • Version metadata in sync: N/A
  • Bottle/runtime migration and launch behavior preserved
  • Docs / compatibility matrix updated for user-facing changes: N/A
  • Regression test added for each bug fix

Test notes

  • game_tuning_test: builds on Linux and passes for VARIANT=regular and VARIANT=fex. The new Retina test fails on unchanged main at the first import assertion.
  • Wrapper: checked in a Linux harness built from the same function. A stale wrapper is replaced with the current text and stays executable.
  • Not run: runtime_routes_test and the full make -C app/src-c test, which build only on macOS.
  • Formatting: git clang-format --diff is clean.

Risk

  • A launch may now run one wine reg import in Steam's prefix: only when the game's Retina differs from what the prefix holds.
  • Two games in one shared prefix with different Retina choices take turns. The last one launched wins, as in GOG's shared prefix already.

Generated by Claude Code

…pper replaced

A game's own Retina setting reached only a bottle (bottles/<id>). A Windows
program runs in Steam's prefix, so the setting it shows in Game settings was
ignored there; and when another game in that prefix did change it, it stayed
for every Steam game after it until Steam's next start. Each launch now sets
the game's own Retina, or Settings > Graphics', in whatever prefix it starts
in, and only when user.reg does not hold it already.

The Wine launch wrapper in cache/ was written once and, when an earlier
MetalSharp's wrapper was there instead, refused: a game's window mode and
resolution were then dropped until MetalSharp was reinstalled. It is now
replaced atomically with this MetalSharp's.

Follow-up to #811.
@aaf2tbz
aaf2tbz merged commit 846e47a into main Nov 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant