diff --git a/CHANGELOG.md b/CHANGELOG.md index a44a18bbab..9a94cf550d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ And please only add new entries to the top of this list, right below the `# Unre # Unreleased +- Implement `HasRawDisplayHandle` for `EventLoop`. + # 0.28.1 - On Wayland, fix crash when dropping a window in multi-window setup. diff --git a/src/event_loop.rs b/src/event_loop.rs index abdd47ece1..a10ba36831 100644 --- a/src/event_loop.rs +++ b/src/event_loop.rs @@ -313,6 +313,13 @@ impl EventLoop { } } +unsafe impl HasRawDisplayHandle for EventLoop { + /// Returns a [`raw_window_handle::RawDisplayHandle`] for the event loop. + fn raw_display_handle(&self) -> RawDisplayHandle { + self.event_loop.window_target().p.raw_display_handle() + } +} + impl Deref for EventLoop { type Target = EventLoopWindowTarget; fn deref(&self) -> &EventLoopWindowTarget {