From ea26b3c7dd4a73d022d45fecfbed539c7d78c0de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 22 Oct 2026 23:04:01 +0200 Subject: [PATCH] SDL: Quit when the main window is closed, with --game-window open too SDL sends a quit only when the last window closes, so with the game window open, closing the main one did nothing. Co-Authored-By: Claude Opus 5.5 (1M context) --- SDL/SDLMain.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index a808a98ef3..19d6bb1ffb 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -1524,6 +1524,13 @@ static void ProcessSDLEvent(SDL_Window *window, const SDL_Event &event, InputSta g_QuitRequested = 1; break; + case SDL_EVENT_WINDOW_CLOSE_REQUESTED: + // SDL only sends a quit when the last window closes, and --game-window's may still be open. + if (SDL_GetWindowFromEvent(&event) == window) { + g_QuitRequested = 1; + } + break; + #if !defined(MOBILE_DEVICE) case SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED: {