Skip to content

Commit

Permalink
Implement HasRawDisplayHandle for EventLoop (#2677)
Browse files Browse the repository at this point in the history
* Implement `HasRawDisplayHandle` for `EventLoop`

* Add changelog entry
  • Loading branch information
SludgePhD authored and kchibisov committed Mar 2, 2023
1 parent 09bca59 commit 230b37d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions src/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,13 @@ impl<T> EventLoop<T> {
}
}

unsafe impl<T> HasRawDisplayHandle for EventLoop<T> {
/// 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<T> Deref for EventLoop<T> {
type Target = EventLoopWindowTarget<T>;
fn deref(&self) -> &EventLoopWindowTarget<T> {
Expand Down

0 comments on commit 230b37d

Please sign in to comment.