浏览代码

Fixed bug #14233 - Android fix Android_WaitActiveAndLockActivity() to make sure Android_Paused state is refreshed

Sylvain 1 周之前
父节点
当前提交
e4c60c05bf
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/video/android/SDL_androidevents.c

+ 6 - 0
src/video/android/SDL_androidevents.c

@@ -243,6 +243,12 @@ void Android_PumpEvents(Sint64 timeoutNS)
 
 bool Android_WaitActiveAndLockActivity(void)
 {
+    /* Make sure we have pumped all events so that Android_Paused state is correct */
+    SDL_AndroidLifecycleEvent event;
+    while (!Android_Destroyed && Android_WaitLifecycleEvent(&event, 0)) {
+        Android_HandleLifecycleEvent(event);
+    }
+
     while (Android_Paused && !Android_Destroyed) {
         Android_PumpEvents(-1);
     }