From 5b8cd9ca774c2abda37fa88300652ceb6e983718 Mon Sep 17 00:00:00 2001 From: knuckleslee <31877375+knuckleslee@users.noreply.github.com> Date: Mon, 19 Oct 2026 22:24:31 +0800 Subject: [PATCH] Bring the game window to the front when it first shows 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 --- src/native_presentation.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/native_presentation.cpp b/src/native_presentation.cpp index f34afab..9973145 100644 --- a/src/native_presentation.cpp +++ b/src/native_presentation.cpp @@ -2166,6 +2166,9 @@ void NativePresentation::present(uint32_t area_width, uint32_t area_height, floa #ifdef _WIN32 ShowWindow(impl_->window, SW_SHOWNORMAL); UpdateWindow(impl_->window); + // Come to the front: the launcher allowed this process to take the + // foreground, and a game that opens behind other windows is easy to miss. + SetForegroundWindow(impl_->window); #else SDL_ShowWindow(impl_->window); #endif