From 69d1a2c5b6ada374f878f45e0b167196c1b5404b Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Tue, 22 Nov 2022 22:22:17 +0100 Subject: [PATCH] Fix MouseButton::Other value on Windows This was a mistake in the transition to windows-sys: https://github.com/rust-windowing/winit/pull/2057 We used winapi's GET_XBUTTON_WPARAM before which is using HIWORD instead of LOWORD: https://docs.rs/winapi/0.3.9/src/winapi/um/winuser.rs.html#1297-1299 --- CHANGELOG.md | 1 + src/platform_impl/windows/mod.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 256f6076e5..f5e695681f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ And please only add new entries to the top of this list, right below the `# Unre # Unreleased +- On Windows, fix the value in `MouseButton::Other`. - On Windows, fix icons specified on `WindowBuilder` not taking effect for windows created after the first one. - On Windows and macOS, add `Window::title` to query the current window title. - On Windows, fix focusing menubar when pressing `Alt`. diff --git a/src/platform_impl/windows/mod.rs b/src/platform_impl/windows/mod.rs index 4e0a07a839..0835e7aabf 100644 --- a/src/platform_impl/windows/mod.rs +++ b/src/platform_impl/windows/mod.rs @@ -120,7 +120,7 @@ impl From for WindowId { #[inline(always)] const fn get_xbutton_wparam(x: u32) -> u16 { - loword(x) + hiword(x) } #[inline(always)]