Explorar el Código

Fixed SDL_RunOnMainThread() on Android

If the application is waiting in SDL_WaitEvent(), we still need to run event loop maintenance in between calls to Android_PumpEvents().

Fixes the testautomation events_mainThreadCallbacks() test on Android.

(cherry picked from commit bae34c3e34f8e7180279a2e5b77c2c79910e4944)
Sam Lantinga hace 5 meses
padre
commit
936d94c2ee
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      src/events/SDL_events.c

+ 2 - 0
src/events/SDL_events.c

@@ -1646,6 +1646,8 @@ bool SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS)
 
 
 #ifdef SDL_PLATFORM_ANDROID
 #ifdef SDL_PLATFORM_ANDROID
     for (;;) {
     for (;;) {
+        SDL_PumpEventsInternal(true);
+
         if (SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_EVENT_FIRST, SDL_EVENT_LAST) > 0) {
         if (SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_EVENT_FIRST, SDL_EVENT_LAST) > 0) {
             return true;
             return true;
         }
         }