What problem does this solve or what need does it fill?
It seems like if the user switches to a different tab, the bevy app will basically freeze and stop getting updated.
This seems to be because running the schedule in wasm is tied to requestAnimationFrame (https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame) calls which are made by winit in the winit_runner.
A potential solution would be:
- if the tab is focused, keep the current scheduling logic
- if the tab is not focused, update the schedule at fixed intervals (for example 60Hz(
What problem does this solve or what need does it fill?
It seems like if the user switches to a different tab, the bevy app will basically freeze and stop getting updated.
This seems to be because running the schedule in wasm is tied to
requestAnimationFrame(https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame) calls which are made by winit in the winit_runner.A potential solution would be: