File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -504,8 +504,16 @@ impl<T: Event> ApplicationHandler<T> for WinitAppRunnerState<T> {
504
504
let begin_frame_time = Instant :: now ( ) ;
505
505
506
506
if should_update {
507
+ let ( _, windows) = focused_windows_state. get ( self . world ( ) ) ;
508
+ // If no windows exist, this will evaluate to `true`.
509
+ let all_invisible = windows. iter ( ) . all ( |w| !w. 1 . visible ) ;
510
+
507
511
// Not redrawing, but the timeout elapsed.
508
- if !self . ran_update_since_last_redraw {
512
+ //
513
+ // Additional condition for Windows OS.
514
+ // If no windows are visible, redraw calls will never succeed, which results in no app update calls being performed.
515
+ // This is a temporary solution, full solution is mentioned here: https://github.com/bevyengine/bevy/issues/1343#issuecomment-770091684
516
+ if !self . ran_update_since_last_redraw || all_invisible {
509
517
self . run_app_update ( ) ;
510
518
self . ran_update_since_last_redraw = true ;
511
519
} else {
You can’t perform that action at this time.
0 commit comments