Skip to content

hadron-steam: Stay the running Steam until the game's last process exits (#128) - #142

Merged
Broyojo merged 1 commit into
mainfrom
steam-relaunch
Oct 26, 2026
Merged

Broyojo merged 1 commit into
mainfrom
steam-relaunch

Conversation

@Broyojo

@Broyojo Broyojo commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Stacked on #141.

DOOM (2016) with the Vulkan renderer runs DOOMx64.exe, which starts DOOMx64vk.exe and exits, and the second one then fails to initialise Steam (#128).

The cause: hadron-steam.exe registers itself as the running Steam process (HKCU\Software\Valve\Steam\ActiveProcess\pid), which steam_api checks, but it only waited for the first process. When that process exited, hadron-steam.exe wrote 0 there and exited too.

The fix:

  • It starts the game in a job and stays registered until the job is empty. The exit status is still the first process's.
  • Wine's explorer.exe would have joined the job, started by whichever process first opens a window. That kept the launcher waiting 5 s after the game was gone, and longer if anything in the prefix had a window open. So hadron-steam.exe starts the desktop itself first, outside the job.
  • services.exe and the services it starts come from the session's first process, which is the launcher, so they stay outside the job too.

Findings #59.

Testing: new tests/win/steam-relaunch.c is a game that starts itself again and exits. The second process checks the registered Steam process the way steam_api does.

  • With the old launcher it finds pid 0.
  • With the new one it finds the launcher running. The launcher returns once the second process has exited (3.8 s), and Wine's session ends right after.
  • Without the desktop start it takes 9 s, and the job's process list shows explorer.exe as what kept it waiting.

DOOM isn't installed here, so it hasn't been tried with the game itself.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-24T23:33:18.576769Z 723603b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…its (#128)

DOOM (2016) starts DOOMx64vk.exe from DOOMx64.exe and exits, and the second
one found no Steam: hadron-steam.exe cleared its registration when the first
process exited. It starts the game in a job now and waits for the job to
empty, after starting Wine's desktop itself so that explorer.exe stays out of
the job. tests/win/steam-relaunch.c, findings #59.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KCKKoKPBaWBVBojHFrLgQ9
Base automatically changed from kk-ubo-range to main October 26, 2026 18:29
@Broyojo
Broyojo merged commit d9265d0 into main Oct 26, 2026
2 checks passed
@Broyojo
Broyojo deleted the steam-relaunch branch October 26, 2026 18:30
@Broyojo Broyojo mentioned this pull request Oct 27, 2026
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