mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 06:11:30 +11:00
Use i32 instead of u32 for position type in WindowEvent::Moved (#1502)
* Use i32 instead of u32 for position type in WindowEvent::Moved * Mark change as breaking
This commit is contained in:
parent
098fd5d602
commit
b1d8ce24e9
|
@ -15,6 +15,7 @@
|
||||||
- On Windows, add `IconExtWindows` trait which exposes creating an `Icon` from an external file or embedded resource
|
- 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
|
- 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
|
- 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)
|
# 0.21.0 (2020-02-04)
|
||||||
|
|
||||||
|
|
|
@ -185,7 +185,7 @@ pub enum WindowEvent<'a> {
|
||||||
Resized(PhysicalSize<u32>),
|
Resized(PhysicalSize<u32>),
|
||||||
|
|
||||||
/// The position of the window has changed. Contains the window's new position.
|
/// The position of the window has changed. Contains the window's new position.
|
||||||
Moved(PhysicalPosition<u32>),
|
Moved(PhysicalPosition<i32>),
|
||||||
|
|
||||||
/// The window has been requested to close.
|
/// The window has been requested to close.
|
||||||
CloseRequested,
|
CloseRequested,
|
||||||
|
|
|
@ -736,7 +736,7 @@ unsafe extern "system" fn public_window_callback<T: 'static>(
|
||||||
let windowpos = lparam as *const winuser::WINDOWPOS;
|
let windowpos = lparam as *const winuser::WINDOWPOS;
|
||||||
if (*windowpos).flags & winuser::SWP_NOMOVE != winuser::SWP_NOMOVE {
|
if (*windowpos).flags & winuser::SWP_NOMOVE != winuser::SWP_NOMOVE {
|
||||||
let physical_position =
|
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 {
|
subclass_input.send_event(Event::WindowEvent {
|
||||||
window_id: RootWindowId(WindowId(window)),
|
window_id: RootWindowId(WindowId(window)),
|
||||||
event: Moved(physical_position),
|
event: Moved(physical_position),
|
||||||
|
|
Loading…
Reference in a new issue