Allow the application to draw while Windows is in a modal move/resize loop

If you're using the application main callbacks, your SDL_AppIterate() function will be called while Windows is moving and resizing your window. If not, then SDL will send an SDL_EVENT_WINDOW_EXPOSED event for your window and you can use an event watcher to redraw your window directly from the callback.

Fixes https://github.com/libsdl-org/SDL/issues/1059
Closes https://github.com/libsdl-org/SDL/pull/4836
This commit is contained in:
Sam Lantinga
2023-11-08 13:11:21 -08:00
parent 1934417b4d
commit 02f356439d
4 changed files with 52 additions and 9 deletions

View File

@@ -45,7 +45,7 @@ int SDL_EnterAppMainCallbacks(int argc, char* argv[], SDL_AppInit_func appinit,
Uint64 next_iteration = callback_rate_increment ? (SDL_GetTicksNS() + callback_rate_increment) : 0;
while ((rc = SDL_IterateMainCallbacks()) == 0) {
while ((rc = SDL_IterateMainCallbacks(SDL_TRUE)) == 0) {
// !!! FIXME: this can be made more complicated if we decide to
// !!! FIXME: optionally hand off callback responsibility to the
// !!! FIXME: video subsystem (for example, if Wayland has a