I tracked it down to the fact that the window does not get SDL_WINDOWEVENT_MINIMIZED flag assigned. Therefore, SDL_RestoreWindow() returns without restoring the window:
if (!(window->flags & (SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED))) {
return;
}
if (_this->RestoreWindow) {
_this->RestoreWindow(_this, window);
}
}
These flags are managed in the SDL_SendWindowEvent() function. So, adding calls to SDL_SendWindowEvent() in SDL_MinimizeWindow() and SDL_RestoreWindow() fixes the problem.
I assume SDL_MaximizeWindow() is affected as well and needs the same fix, but I did not try it.
nc-pv
Joined: 06 Jan 2017
Posts: 3
Posted: Thu Jan 19, 2017 12:11 am
Sorry, I misspelled the flag name. It is SDL_WINDOW_MINIMIZED flag.
Quote:
I tracked it down to the fact that the window does not get SDL_WINDOWEVENT_MINIMIZED flag assigned. Therefore, SDL_RestoreWindow() returns without restoring the window: