diff --git a/src/changelog/unreleased.md b/src/changelog/unreleased.md index b3df644625..11f65fb388 100644 --- a/src/changelog/unreleased.md +++ b/src/changelog/unreleased.md @@ -47,3 +47,6 @@ changelog entry. ### Fixed - On Wayland, avoid crashing when compositor is misbehaving. +- On Web, fix `WindowEvent::Resized` not using `requestAnimationFrame` when sending + `WindowEvent::RedrawRequested` and also potentially causing `WindowEvent::RedrawRequested` + to not be de-duplicated. diff --git a/src/platform_impl/web/event_loop/window_target.rs b/src/platform_impl/web/event_loop/window_target.rs index eb0051d36d..85148281e7 100644 --- a/src/platform_impl/web/event_loop/window_target.rs +++ b/src/platform_impl/web/event_loop/window_target.rs @@ -605,7 +605,7 @@ impl ActiveEventLoop { window_id: RootWindowId(id), event: WindowEvent::Resized(new_size), }); - runner.request_redraw(RootWindowId(id)); + canvas.request_animation_frame(); } } },