force last update after setting state to Suspended (#15888)

# Objective

- Android doesn't receive lifecycle event `Suspended` before suspension

## Solution

- Fix update triggering just after state change on android

## Testing

- Tested on the android emulator
This commit is contained in:
François Mockers 2024-10-14 03:40:03 +02:00 committed by GitHub
parent 9dd6f42b32
commit 89e19aaff0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -475,6 +475,7 @@ impl<T: Event> ApplicationHandler<T> for WinitAppRunnerState<T> {
self.lifecycle = AppLifecycle::Suspended; self.lifecycle = AppLifecycle::Suspended;
// Trigger one last update to enter the suspended state // Trigger one last update to enter the suspended state
should_update = true; should_update = true;
self.ran_update_since_last_redraw = false;
#[cfg(target_os = "android")] #[cfg(target_os = "android")]
{ {