From e88e8bc1942865098b98419f6f7f07f73fc26179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n?= Date: Sun, 16 Feb 2020 18:53:02 +0100 Subject: [PATCH] Map `UserEvent` properly in `Event::to_static` (#1468) --- CHANGELOG.md | 1 + src/event.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5876b529..ed9baa58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/src/event.rs b/src/event.rs index 10ab6217..494a4a1d 100644 --- a/src/event.rs +++ b/src/event.rs @@ -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),