Map UserEvent properly in Event::to_static (#1468)

This commit is contained in:
Héctor Ramón
2020-02-16 18:53:02 +01:00
committed by GitHub
parent bc29931434
commit e88e8bc194
2 changed files with 2 additions and 1 deletions

View File

@@ -5,6 +5,7 @@
- On Wayland, fix color from `close_button_icon_color` not applying.
- Ignore locale if unsupported by X11 backend
- On Wayland, Add HiDPI cursor support
- Fix `Event::to_static` returning `None` for user events.
# 0.21.0 (2020-02-04)

View File

@@ -139,7 +139,7 @@ impl<'a, T> Event<'a, T> {
WindowEvent { window_id, event } => event
.to_static()
.map(|event| WindowEvent { window_id, event }),
UserEvent(_) => None,
UserEvent(event) => Some(UserEvent(event)),
DeviceEvent { device_id, event } => Some(DeviceEvent { device_id, event }),
NewEvents(cause) => Some(NewEvents(cause)),
MainEventsCleared => Some(MainEventsCleared),