diff --git a/CHANGELOG.md b/CHANGELOG.md index 66b609513e..5be490485e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Unreleased` header. - On X11, check common alternative cursor names when loading cursor. - On Windows, fix so `drag_window` and `drag_resize_window` can be called from another thread. +- On macOS, send a `Resized` event after each `ScaleFactorChanged` event. # 0.29.3 diff --git a/src/platform_impl/macos/app_state.rs b/src/platform_impl/macos/app_state.rs index 114c124f5e..33cc1d88e6 100644 --- a/src/platform_impl/macos/app_state.rs +++ b/src/platform_impl/macos/app_state.rs @@ -329,7 +329,7 @@ impl Handler { ) { if let Some(ref mut callback) = *self.callback.lock().unwrap() { let new_inner_size = Arc::new(Mutex::new(suggested_size)); - let event = Event::WindowEvent { + let scale_factor_changed_event = Event::WindowEvent { window_id: WindowId(window.id()), event: WindowEvent::ScaleFactorChanged { scale_factor, @@ -337,13 +337,19 @@ impl Handler { }, }; - callback.handle_nonuser_event(event); + callback.handle_nonuser_event(scale_factor_changed_event); let physical_size = *new_inner_size.lock().unwrap(); drop(new_inner_size); let logical_size = physical_size.to_logical(scale_factor); let size = NSSize::new(logical_size.width, logical_size.height); window.setContentSize(size); + + let resized_event = Event::WindowEvent { + window_id: WindowId(window.id()), + event: WindowEvent::Resized(physical_size), + }; + callback.handle_nonuser_event(resized_event); } } }