diff --git a/CHANGELOG.md b/CHANGELOG.md index 4667cf47..b169fb0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ And please only add new entries to the top of this list, right below the `# Unre - Implement `HasRawDisplayHandle` for `EventLoop`. - On macOS, set resize increments only for live resizes. +- On Wayland, fix rare crash on DPI change # 0.28.1 diff --git a/src/platform_impl/linux/wayland/window/mod.rs b/src/platform_impl/linux/wayland/window/mod.rs index a775b307..14c31788 100644 --- a/src/platform_impl/linux/wayland/window/mod.rs +++ b/src/platform_impl/linux/wayland/window/mod.rs @@ -128,6 +128,12 @@ impl Window { let surface = event_loop_window_target .env .create_surface_with_scale_callback(move |scale, surface, mut dispatch_data| { + // While I'm not sure how this could happen, we can safely ignore it + // for now as a quickfix. + if !surface.as_ref().is_alive() { + return; + } + let winit_state = dispatch_data.get::().unwrap(); // Get the window that received the event.