`low_power` example does not work on WASM
Bevy version
0.14
What you did
- Run the web example: https://bevyengine.org/examples/window/low-power/
- Press space until you get to the third mode, with
RequestRedrawbeing sent
What went wrong
The event loop should run continuously as long as the event is being sent. However, it does not.
Additional information
let _ = event_loop_proxy.send_event(WakeUp); was added to the example, but the docs all refer to RequestRedraw. Replacing the event loop proxy wakeup with RequestRedraw appears to fix the behavior.
The event loop proxy is useful when waking from another thread, but it appears it is not a direct replacement for the bevy event on all platforms.
the issue seems to be that in Wasm, user events don't interrupt when the event loop is waiting
Retested, and edited my original report, I was wrong about some of the behavior.
Do we just need to update the example? RequestRedraw seems to work as expected.
I updated the example to be more explicit about RequestRedraw and WakeUp in https://github.com/bevyengine/bevy/pull/14224
I'll try to get it working in Wasm too... but later
the issue seems to be that in Wasm, user events don't interrupt when the event loop is waiting
Let me know if this is a Winit bug, last time I checked user events should wake up the event loop correctly on Webwith Winit.