Skip to content

Bring the game window to the front when it first shows - #229

Merged
YuutaTsubasa merged 1 commit into
YuutaTsubasa:mainfrom
knuckleslee:pr/window-foreground
Oct 21, 2026
Merged

YuutaTsubasa merged 1 commit into
YuutaTsubasa:mainfrom
knuckleslee:pr/window-foreground

Conversation

@knuckleslee

@knuckleslee knuckleslee commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

When the game shows its window for the first time (after the first frame is ready), it now also calls SetForegroundWindow on Windows.

Why

The window is only shown once the first frame is ready, which can be well after the launcher started the game. By then another window, often the launcher's own, may be in front, and a game that opens behind it is easy to miss. The launcher already lets the game process take the foreground (AllowSetForegroundWindow in launcher_platform_win32.cpp), so the game only has to ask for it.

Scope

  • 3 lines in src/native_presentation.cpp, inside the existing _WIN32 branch. Other platforms are unchanged.

Tested

  • Windows 10, game started from the launcher: the window opens in front of the launcher and other windows.
  • The same lines compiled in a build of current main merged with other work of mine, where the test suite passed except native_presentation (it creates a 37x23 window; on this machine, at 125% DPI, the client size is not 37 wide). The CI's Windows job runs that test and passes, so the failure is specific to my machine's DPI scaling.

🤖 Generated with Claude Code

The window is shown only once the first frame is ready, which can be
well after the launcher started the game. By then another window, often
the launcher's own, may be in front, and a game that opens behind it is
easy to miss. The launcher already lets the game process take the
foreground (AllowSetForegroundWindow in launcher_platform_win32.cpp), so
the game asks for it when it shows the window. Windows only; the other
platforms are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@YuutaTsubasa
YuutaTsubasa merged commit c96a845 into YuutaTsubasa:main Oct 21, 2026
4 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.

2 participants