sdl: react upon framebuffer resize to 0x0

Treat minimizing the framebuffer as explicit SDL_QUIT event.
This commit is contained in:
Josef Söntgen 2018-06-01 14:07:11 +02:00 committed by Christian Helmuth
parent bd91e70fae
commit e6c5ea21b4

View File

@ -94,7 +94,20 @@ extern "C" {
if (video_events.resize_pending) {
video_events.resize_pending = false;
SDL_PrivateResize(video_events.width, video_events.height);
int const width = video_events.width;
int const height = video_events.height;
bool const quit = width == 0 && height == 0;
if (!quit)
SDL_PrivateResize(width, height);
else {
/* at least try to quit w/o other event handling */
if (SDL_PrivateQuit())
return;
else
Genode::warning("could not deliver requested SDL_QUIT event");
}
}
if (!input->pending())