diff --git a/CHANGELOG.md b/CHANGELOG.md index 0111b9433d..9fd2b3b262 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - On Windows, add `IconExtWindows` trait which exposes creating an `Icon` from an external file or embedded resource - Add `BadIcon::OsError` variant for when OS icon functionality fails - On Windows, fix crash at startup on systems that do not properly support Windows' Dark Mode +- **Breaking:** Use `i32` instead of `u32` for position type in `WindowEvent::Moved`. # 0.21.0 (2020-02-04) diff --git a/src/event.rs b/src/event.rs index e7e7be9e31..4756f3d895 100644 --- a/src/event.rs +++ b/src/event.rs @@ -185,7 +185,7 @@ pub enum WindowEvent<'a> { Resized(PhysicalSize), /// The position of the window has changed. Contains the window's new position. - Moved(PhysicalPosition), + Moved(PhysicalPosition), /// The window has been requested to close. CloseRequested, diff --git a/src/platform_impl/windows/event_loop.rs b/src/platform_impl/windows/event_loop.rs index 26a2d321f2..5f632c3b4b 100644 --- a/src/platform_impl/windows/event_loop.rs +++ b/src/platform_impl/windows/event_loop.rs @@ -736,7 +736,7 @@ unsafe extern "system" fn public_window_callback( let windowpos = lparam as *const winuser::WINDOWPOS; if (*windowpos).flags & winuser::SWP_NOMOVE != winuser::SWP_NOMOVE { let physical_position = - PhysicalPosition::new((*windowpos).x as u32, (*windowpos).y as u32); + PhysicalPosition::new((*windowpos).x as i32, (*windowpos).y as i32); subclass_input.send_event(Event::WindowEvent { window_id: RootWindowId(WindowId(window)), event: Moved(physical_position),