diff -r 756b49205a29 -r 6ad1a4213954 src/window.c --- a/src/window.c Tue Nov 07 20:24:08 2023 +0100 +++ b/src/window.c Tue Nov 07 20:59:10 2023 +0100 @@ -28,6 +28,7 @@ #include "ascension/window.h" #include "ascension/context.h" #include "ascension/error.h" +#include "ascension/utils.h" #include #include @@ -66,7 +67,9 @@ SDL_Event event; while (SDL_PollEvent(&event)) { switch (event.type) { - case SDL_QUIT:return false; + case SDL_QUIT: + asc_set_flag(&asc_context.flags, ASC_FLAG_QUIT); + break; case SDL_WINDOWEVENT: { if (event.window.type == SDL_WINDOWEVENT_RESIZED) asc_event_window_resized( @@ -93,7 +96,8 @@ asc_window_sync(&asc_context.windows[i]); } } - return true; + + return !asc_test_flag(asc_context.flags, ASC_FLAG_QUIT); } void asc_window_settings_init_defaults(AscWindowSettings* settings) {