bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
33.56k stars 3.26k forks source link

Panic if changing browser zoom in WASM with an overridden scale factor #13487

Open pietrosophya opened 1 month ago

pietrosophya commented 1 month ago

Bevy version

Main and 0.13.

What you did

Given:

the app crashes.

What went wrong

The problem is that the bevy_winit plugin reacts to the WindowEvent::ScaleFactorChanged, that's received from winit holding a borrow_mut on the ResizeScaleHandle, and immediately requesting a new inner size.

Happens also on the winit 0.30 PR, for the same reason.

pietrosophya commented 1 month ago

I created also a winit issue (but I'm not sure if this should be handled in both places.

daxpedda commented 2 weeks ago

This was fixed in https://github.com/rust-windowing/winit/pull/3727 which landed in Winit v0.30.2.