diff --git a/src/changelog/unreleased.md b/src/changelog/unreleased.md index 9350bb2f1f..dd7e00b815 100644 --- a/src/changelog/unreleased.md +++ b/src/changelog/unreleased.md @@ -53,3 +53,4 @@ changelog entry. ### Fixed - On macOS, fix panic on exit when dropping windows outside the event loop. +- On macOS, fix window dragging glitches when dragging across a monitor boundary with different scale factor. diff --git a/src/platform_impl/macos/app_delegate.rs b/src/platform_impl/macos/app_delegate.rs index 984f4d099e..ca0d08ae1d 100644 --- a/src/platform_impl/macos/app_delegate.rs +++ b/src/platform_impl/macos/app_delegate.rs @@ -375,9 +375,11 @@ impl ApplicationDelegate { 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); + if physical_size != suggested_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: RootWindowId(window.id()),