From 4f1a9f1c8c69b0808e64c4a72e4cc6fe3596c5b7 Mon Sep 17 00:00:00 2001 From: John Nunley Date: Sun, 9 Jul 2023 20:41:06 -0700 Subject: [PATCH] Missed one --- src/event_loop.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/event_loop.rs b/src/event_loop.rs index f9927504688..68b64700019 100644 --- a/src/event_loop.rs +++ b/src/event_loop.rs @@ -400,6 +400,14 @@ unsafe impl HasRawDisplayHandle for EventLoopWindowTarget { } } +impl HasDisplayHandle for EventLoopWindowTarget { + fn display_handle(&self) -> Result, HandleError> { + // SAFETY: The returned display handle is always valid for this lifetime. + self.raw_display_handle() + .map(|handle| unsafe { DisplayHandle::borrow_raw(handle) }) + } +} + unsafe impl raw_window_handle_05::HasRawDisplayHandle for EventLoopWindowTarget { fn raw_display_handle(&self) -> raw_window_handle_05::RawDisplayHandle { let result = HasRawDisplayHandle::raw_display_handle(self);