Skip to content

fix(linux): find Windows programs running under Wine - #12

Open
ayozetr wants to merge 1 commit into
RaidTheory:mainfrom
ayozetr:fix/linux-find-wine-processes
Open

fix(linux): find Windows programs running under Wine#12
ayozetr wants to merge 1 commit into
RaidTheory:mainfrom
ayozetr:fix/linux-find-wine-processes

Conversation

@ayozetr

@ayozetr ayozetr commented Aug 12, 2026

Copy link
Copy Markdown

find_processes cannot see a Proton-run game at all, so game_running is permanently false on Linux and every check that looks for the game by name silently finds nothing.

Neither of its two lookups can work for a Wine process:

  • /proc/<pid>/exe resolves to the Wine preloader, not the program.
  • comm holds whatever the program named its main thread, capped at 15 bytes. ARC Raiders reports GameThread.

Observed on a running game:

comm    = GameThread
exe     = wine64-preloader
cmdline = S:\common\Arc Raiders\PioneerGame\Binaries\Win64\PioneerGame.exe

So this also matches argv[0] from /proc/<pid>/cmdline, where the Windows path survives intact. Splitting that needs a basename helper that understands backslashes, since Path::file_name sees the whole Windows path as a single component on Linux.

names_match now drops a trailing .exe from both sides rather than only the query, so the Wine-hosted steam.exe matches the same query that native Steam's comm of steam matches. It also lowercases before stripping, because strip_suffix is case-sensitive and a .EXE spelling kept its suffix — a test caught that one.

Context in #8.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

find_processes could not see a Proton-run game at all, so "is the user
playing?" was permanently false on Linux and any check that looks for the
game by name silently found nothing.

Neither of its two lookups can work for a Wine process: /proc/<pid>/exe
resolves to the Wine preloader rather than the program, and comm holds
whatever the program named its main thread, capped at 15 bytes — ARC Raiders
reports "GameThread". Match argv[0] from /proc/<pid>/cmdline as well, where
the Windows path survives intact:

    S:\common\Arc Raiders\PioneerGame\Binaries\Win64\PioneerGame.exe

Splitting that needs a basename helper that understands backslashes, since
Path::file_name sees the whole Windows path as one component on Linux.

names_match now drops a trailing .exe from both sides instead of only the
query, so the Wine-hosted steam.exe matches the same "steam.exe" query that
native Steam's comm of "steam" matches, and it lowercases before stripping
because strip_suffix is case-sensitive and a .EXE spelling kept its suffix.
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