From d1c6506865c7bddbb5fb4d80a613e43ddc1370b5 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sat, 4 Jan 2020 05:11:00 +0000 Subject: [PATCH] Fix ModifiersChanged event on X11 (#1358) --- CHANGELOG.md | 2 ++ src/platform_impl/linux/x11/util/input.rs | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10c48558..55033c9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased +- On X11, fix `ModifiersChanged` emitting incorrect modifier change events + # 0.20.0 Alpha 6 (2020-01-03) - On macOS, fix `set_cursor_visible` hides cursor outside of window. diff --git a/src/platform_impl/linux/x11/util/input.rs b/src/platform_impl/linux/x11/util/input.rs index 5af033d3..e9f45aee 100644 --- a/src/platform_impl/linux/x11/util/input.rs +++ b/src/platform_impl/linux/x11/util/input.rs @@ -18,9 +18,9 @@ impl ModifiersState { pub(crate) fn from_x11_mask(mask: c_uint) -> Self { let mut m = ModifiersState::empty(); - m.set(ModifiersState::SHIFT, mask & ffi::Mod1Mask != 0); - m.set(ModifiersState::CTRL, mask & ffi::ShiftMask != 0); - m.set(ModifiersState::ALT, mask & ffi::ControlMask != 0); + m.set(ModifiersState::ALT, mask & ffi::Mod1Mask != 0); + m.set(ModifiersState::SHIFT, mask & ffi::ShiftMask != 0); + m.set(ModifiersState::CTRL, mask & ffi::ControlMask != 0); m.set(ModifiersState::LOGO, mask & ffi::Mod4Mask != 0); m }