Fix ModifiersChanged event on X11 (#1358)

This commit is contained in:
Christian Duerr 2020-01-04 05:11:00 +00:00 committed by Murarth
parent c0b46a03b5
commit d1c6506865
2 changed files with 5 additions and 3 deletions

View file

@ -1,5 +1,7 @@
# Unreleased # Unreleased
- On X11, fix `ModifiersChanged` emitting incorrect modifier change events
# 0.20.0 Alpha 6 (2020-01-03) # 0.20.0 Alpha 6 (2020-01-03)
- On macOS, fix `set_cursor_visible` hides cursor outside of window. - On macOS, fix `set_cursor_visible` hides cursor outside of window.

View file

@ -18,9 +18,9 @@ impl ModifiersState {
pub(crate) fn from_x11_mask(mask: c_uint) -> Self { pub(crate) fn from_x11_mask(mask: c_uint) -> Self {
let mut m = ModifiersState::empty(); let mut m = ModifiersState::empty();
m.set(ModifiersState::SHIFT, mask & ffi::Mod1Mask != 0); m.set(ModifiersState::ALT, mask & ffi::Mod1Mask != 0);
m.set(ModifiersState::CTRL, mask & ffi::ShiftMask != 0); m.set(ModifiersState::SHIFT, mask & ffi::ShiftMask != 0);
m.set(ModifiersState::ALT, mask & ffi::ControlMask != 0); m.set(ModifiersState::CTRL, mask & ffi::ControlMask != 0);
m.set(ModifiersState::LOGO, mask & ffi::Mod4Mask != 0); m.set(ModifiersState::LOGO, mask & ffi::Mod4Mask != 0);
m m
} }