Hide the window immediately on close

The screen may not be destroyed immediately on close to avoid undefined
behavior, because it may still receive events from the decoder.

But the visual window must still be closed immediately.
This commit is contained in:
Romain Vimont
2021-04-13 22:22:54 +02:00
parent 0272e6dc77
commit 0541f1bff2
3 changed files with 16 additions and 0 deletions

View File

@@ -453,6 +453,11 @@ screen_show_window(struct screen *screen) {
SDL_ShowWindow(screen->window);
}
void
screen_hide_window(struct screen *screen) {
SDL_HideWindow(screen->window);
}
void
screen_destroy(struct screen *screen) {
#ifndef NDEBUG