diff --git a/src/os/posix/wayland.rs b/src/os/posix/wayland.rs index 6845881..1bcdf5a 100644 --- a/src/os/posix/wayland.rs +++ b/src/os/posix/wayland.rs @@ -1267,6 +1267,14 @@ unsafe impl raw_window_handle::HasRawWindowHandle for Window { fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle { let mut handle = raw_window_handle::WaylandWindowHandle::empty(); handle.surface = self.display.surface.as_ref().c_ptr() as *mut _ as *mut c_void; + + raw_window_handle::RawWindowHandle::Wayland(handle) + } +} + +unsafe impl raw_window_handle::HasRawDisplayHandle for Window { + fn raw_display_handle(&self) -> raw_window_handle::RawDisplayHandle { + let mut handle = WaylandDisplayHandle::empty(); handle.display = self .display .attached_display @@ -1275,7 +1283,7 @@ unsafe impl raw_window_handle::HasRawWindowHandle for Window { .as_ref() .c_ptr() as *mut _ as *mut c_void; - raw_window_handle::RawWindowHandle::Wayland(handle) + RawDisplayHandle::Wayland(handle) } } diff --git a/src/os/posix/x11.rs b/src/os/posix/x11.rs index 9bf3dce..49429cc 100644 --- a/src/os/posix/x11.rs +++ b/src/os/posix/x11.rs @@ -334,11 +334,19 @@ unsafe impl raw_window_handle::HasRawWindowHandle for Window { fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle { let mut handle = raw_window_handle::XlibWindowHandle::empty(); handle.window = self.handle; - handle.display = self.d.display as *mut core::ffi::c_void; raw_window_handle::RawWindowHandle::Xlib(handle) } } +unsafe impl HasRawDisplayHandle for Window { + fn raw_display_handle(&self) -> raw_window_handle::RawDisplayHandle { + let mut handle = raw_window_handle::XlibDisplayHandle::empty(); + handle.display = self.d.display as *mut core::ffi::c_void; + + RawDisplayHandle::Xlib(handle) + } +} + impl Window { pub fn new(name: &str, width: usize, height: usize, opts: WindowOptions) -> Result { let name = match CString::new(name) {