mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-10 05:01:31 +11:00
On Wayland, fix rare crash on DPI change
While I don't understand the root cause for this issue, we can dirty fix like that for now.
This commit is contained in:
parent
82df9531f4
commit
0f89aac9f6
|
@ -10,6 +10,7 @@ And please only add new entries to the top of this list, right below the `# Unre
|
||||||
|
|
||||||
- Implement `HasRawDisplayHandle` for `EventLoop`.
|
- Implement `HasRawDisplayHandle` for `EventLoop`.
|
||||||
- On macOS, set resize increments only for live resizes.
|
- On macOS, set resize increments only for live resizes.
|
||||||
|
- On Wayland, fix rare crash on DPI change
|
||||||
|
|
||||||
# 0.28.1
|
# 0.28.1
|
||||||
|
|
||||||
|
|
|
@ -128,6 +128,12 @@ impl Window {
|
||||||
let surface = event_loop_window_target
|
let surface = event_loop_window_target
|
||||||
.env
|
.env
|
||||||
.create_surface_with_scale_callback(move |scale, surface, mut dispatch_data| {
|
.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::<WinitState>().unwrap();
|
let winit_state = dispatch_data.get::<WinitState>().unwrap();
|
||||||
|
|
||||||
// Get the window that received the event.
|
// Get the window that received the event.
|
||||||
|
|
Loading…
Reference in a new issue