Handle window closing event to stop SoH (#1556)

* Handle window closing event to stop app

* Address PR comments
This commit is contained in:
David Chavez 2022-09-25 18:12:38 +02:00 committed by GitHub
parent fde05e65c0
commit 3a2fcc9604
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -304,6 +304,10 @@ static void gfx_sdl_handle_events(void) {
#else #else
SDL_GL_GetDrawableSize(wnd, &window_width, &window_height); SDL_GL_GetDrawableSize(wnd, &window_width, &window_height);
#endif #endif
} else if (event.window.event == SDL_WINDOWEVENT_CLOSE && event.window.windowID == SDL_GetWindowID(wnd)) {
// We listen specifically for main window close because closing main window
// on macOS does not trigger SDL_Quit.
is_running = false;
} }
break; break;
case SDL_DROPFILE: case SDL_DROPFILE: