Skip to content

Add per-game virtual desktop resolution configuration#14

Open
aegispotae wants to merge 1 commit intoitalomandara:mainfrom
aegispotae:configres
Open

Add per-game virtual desktop resolution configuration#14
aegispotae wants to merge 1 commit intoitalomandara:mainfrom
aegispotae:configres

Conversation

@aegispotae
Copy link

Summary

  • Adds Wine registry (.reg) file parser with backup support (.orig and .procyon-backup)
  • Per-game virtual desktop resolution configuration based on CXRes logic
  • Resolution applied to bottle's user.reg at game launch time (only if changed)
  • Display detection for quick resolution presets

New Files

  • Procyon/Util/WineRegistry.swift — Generic Wine .reg file parser (read/edit/write with format preservation)
  • Procyon/Util/Resolution.swiftBottleResolutionManager for resolution configuration

Modified Files

  • Procyon/Types.swift — Added virtualDesktopEnabled and virtualDesktopResolution to game options
  • Procyon/Components/GameOptionsView.swift — Resolution UI section for non-native games
  • Procyon/Util/Launcher.swift — Applies per-game resolution before launch
  • .gitignore — Added .DS_Store and xcuserdata/

Test plan

  • Open game options for a Windows game and verify Resolution section appears
  • Toggle virtual desktop and set resolution, save settings
  • Launch game and verify user.reg is updated with correct resolution
  • Verify .orig backup is created on first write
  • Verify .procyon-backup is created on subsequent writes
  • Confirm native games don't show the resolution section
  • Launch multiple games with different resolution settings and verify each applies correctly

🤖 Generated with Claude Code

Adds Wine registry (.reg) file parsing and per-game resolution
configuration to Procyon, based on CXRes logic.

## New Files

- Procyon/Util/WineRegistry.swift — Generic Wine .reg file parser
  - Parses user.reg into sections with typed key-value pairs
    (string, dword, hex, expandString)
  - Read, edit, and write back preserving original formatting
  - Backup system: first save creates ".orig",
    subsequent saves create ".procyon-backup"

- Procyon/Util/Resolution.swift — Resolution configuration
  - BottleResolutionManager reads/writes Software\\Wine\\Explorer and
    Software\\Wine\\Explorer\\Desktops registry keys to toggle
    virtual desktop and set resolution
  - ResolutionState holds current state (enabled, resolution, DPI)
  - detectDisplayProfiles() detects connected displays for quick presets

## Modified Files

- Procyon/Types.swift — Added virtualDesktopEnabled and
  virtualDesktopResolution to both GameOptionsData and GameOptions

- Procyon/Components/GameOptionsView.swift
  - "Resolution (Virtual Desktop)" section for non-native games
    with toggle, resolution text field, and display detection buttons
  - Loads current resolution state from bottle's user.reg on appear

- Procyon/Util/Launcher.swift
  - Applies per-game resolution to user.reg before launch
  - Only writes if resolution actually changed (avoids unnecessary I/O)

- .gitignore — Added .DS_Store and xcuserdata/

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@italomandara
Copy link
Owner

italomandara commented Mar 20, 2026

Thanks for your contribution, this will take some time to review it's quite a big one

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.

2 participants