diff options
-rw-r--r-- | src/app.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -1208,10 +1208,6 @@ iLocalDef iBool isWaitingAllowed_App_(iApp *d) { | |||
1208 | } | 1208 | } |
1209 | 1209 | ||
1210 | static iBool nextEvent_App_(iApp *d, enum iAppEventMode eventMode, SDL_Event *event) { | 1210 | static iBool nextEvent_App_(iApp *d, enum iAppEventMode eventMode, SDL_Event *event) { |
1211 | if (d->isSuspended) { | ||
1212 | /* Do nothing except wait for the app to return to the foreground. */ | ||
1213 | return SDL_WaitEvent(event); | ||
1214 | } | ||
1215 | if (eventMode == waitForNewEvents_AppEventMode && isWaitingAllowed_App_(d)) { | 1211 | if (eventMode == waitForNewEvents_AppEventMode && isWaitingAllowed_App_(d)) { |
1216 | /* If there are periodic commands pending, wait only for a short while. */ | 1212 | /* If there are periodic commands pending, wait only for a short while. */ |
1217 | if (!isEmpty_Periodic(&d->periodic)) { | 1213 | if (!isEmpty_Periodic(&d->periodic)) { |
@@ -1462,10 +1458,10 @@ void processEvents_App(enum iAppEventMode eventMode) { | |||
1462 | deinit_PtrArray(&windows); | 1458 | deinit_PtrArray(&windows); |
1463 | #if defined (LAGRANGE_ENABLE_IDLE_SLEEP) | 1459 | #if defined (LAGRANGE_ENABLE_IDLE_SLEEP) |
1464 | if (d->isIdling && !gotEvents) { | 1460 | if (d->isIdling && !gotEvents) { |
1465 | /* This is where we spend most of our time when idle. 60 Hz still quite a lot but we | 1461 | /* This is where we spend most of our time when idle. 30 Hz still quite a lot but we |
1466 | can't wait too long after the user tries to interact again with the app. In any | 1462 | can't wait too long after the user tries to interact again with the app. In any |
1467 | case, on macOS SDL_WaitEvent() seems to use 10x more CPU time than sleeping. */ | 1463 | case, on iOS SDL_WaitEvent() seems to use 10x more CPU time than sleeping (2.0.18). */ |
1468 | SDL_Delay(1000 / 60); | 1464 | SDL_Delay(1000 / 30); |
1469 | } | 1465 | } |
1470 | #endif | 1466 | #endif |
1471 | backToMainLoop:; | 1467 | backToMainLoop:; |