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) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-22 23:04:01 +02:00
1 parent 013460b2fe
commit ea26b3c7dd
1 file changed
+7
+7
View File
@@ -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:
{