mirror of
https://github.com/yawut/SDL.git
synced 2026-08-28 03:34:44 -05:00
Send the SDL_QUIT when last window is destroyed, not during its close event.
This commit is contained in:
@@ -197,13 +197,6 @@ SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, int data1,
|
||||
posted = (SDL_PushEvent(&event) > 0);
|
||||
}
|
||||
|
||||
if (windowevent == SDL_WINDOWEVENT_CLOSE) {
|
||||
if ( !window->prev && !window->next ) {
|
||||
/* This is the last window in the list so send the SDL_QUIT event */
|
||||
SDL_SendQuit();
|
||||
}
|
||||
}
|
||||
|
||||
return (posted);
|
||||
}
|
||||
|
||||
|
||||
@@ -2210,6 +2210,11 @@ SDL_DestroyWindow(SDL_Window * window)
|
||||
}
|
||||
|
||||
SDL_free(window);
|
||||
|
||||
if (_this->windows == NULL) {
|
||||
/* This is the last window in the list so send the SDL_QUIT event */
|
||||
SDL_SendQuit();
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
|
||||
Reference in New Issue
Block a user