File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -407,11 +407,16 @@ pub fn winit_runner(mut app: App) {
407
407
should_update = true ;
408
408
}
409
409
410
+ // Trigger one last update to enter suspended state
411
+ if runner_state. active == ActiveState :: WillSuspend {
412
+ should_update = true ;
413
+ }
414
+
410
415
if should_update {
411
416
let visible = windows. iter ( ) . any ( |window| window. visible ) ;
412
417
let ( _, winit_windows, _, _) =
413
418
event_writer_system_state. get_mut ( & mut app. world ) ;
414
- if visible {
419
+ if visible && runner_state . active != ActiveState :: WillSuspend {
415
420
for window in winit_windows. windows . values ( ) {
416
421
window. request_redraw ( ) ;
417
422
}
@@ -427,7 +432,9 @@ pub fn winit_runner(mut app: App) {
427
432
& mut app_exit_event_reader,
428
433
& mut redraw_event_reader,
429
434
) ;
430
- event_loop. set_control_flow ( ControlFlow :: Poll ) ;
435
+ if runner_state. active != ActiveState :: Suspended {
436
+ event_loop. set_control_flow ( ControlFlow :: Poll ) ;
437
+ }
431
438
}
432
439
}
433
440
}
You can’t perform that action at this time.
0 commit comments