chore: add rwh-6 feature
This commit is contained in:
parent
a698efe935
commit
2263426a09
2 changed files with 13 additions and 1 deletions
|
|
@ -34,6 +34,16 @@ impl<T: RawSurface> DndSurface<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "rwh-6")]
|
||||
impl<'a> RawSurface for raw_window_handle::WindowHandle<'a> {
|
||||
unsafe fn get_ptr(&mut self) -> *mut c_void {
|
||||
match self.as_raw() {
|
||||
raw_window_handle::RawWindowHandle::Wayland(handle) => handle.surface.as_ptr().cast(),
|
||||
_ => panic!("Unsupported window handle type."),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl RawSurface for WlSurface {
|
||||
unsafe fn get_ptr(&mut self) -> *mut c_void {
|
||||
self.id().as_ptr().cast()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue