Просмотр исходного кода

Main callbacks should be processed even if events are already pending in SDL_WaitEvent()

Fixes https://github.com/libsdl-org/SDL/issues/15485
Sam Lantinga 2 недель назад
Родитель
Сommit
757400e044
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      src/events/SDL_events.c

+ 4 - 0
src/events/SDL_events.c

@@ -1755,6 +1755,10 @@ bool SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS)
         }
     } else {
         // Has existing events
+        if (!event) {
+            // The application expects callbacks to run even if events are pending
+            SDL_RunMainThreadCallbacks();
+        }
         return true;
     }
     // We should have completely handled timeoutNS == 0 above