mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 13:20:06 -04:00
feat: Add an owned display handle type
This was supposed to be rolled out with the rwh v0.6 update, but it was left behind for some reason. I've added this type back. Signed-off-by: John Nunley <dev@notgull.net>
This commit is contained in:
@@ -771,4 +771,27 @@ impl EventLoopWindowTarget {
|
||||
pub(crate) fn exiting(&self) -> bool {
|
||||
self.exit.get()
|
||||
}
|
||||
|
||||
pub(crate) fn owned_display_handle(&self) -> OwnedDisplayHandle {
|
||||
OwnedDisplayHandle
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub(crate) struct OwnedDisplayHandle;
|
||||
|
||||
impl OwnedDisplayHandle {
|
||||
#[cfg(feature = "rwh_05")]
|
||||
#[inline]
|
||||
pub fn raw_display_handle_rwh_05(&self) -> rwh_05::RawDisplayHandle {
|
||||
rwh_05::OrbitalDisplayHandle::empty().into()
|
||||
}
|
||||
|
||||
#[cfg(feature = "rwh_06")]
|
||||
#[inline]
|
||||
pub fn raw_display_handle_rwh_06(
|
||||
&self,
|
||||
) -> Result<rwh_06::RawDisplayHandle, rwh_06::HandleError> {
|
||||
Ok(rwh_06::OrbitalDisplayHandle::new().into())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@ use std::sync::Arc;
|
||||
|
||||
use crate::dpi::{PhysicalPosition, PhysicalSize};
|
||||
|
||||
pub use self::event_loop::{EventLoop, EventLoopProxy, EventLoopWindowTarget};
|
||||
pub(crate) use self::event_loop::{
|
||||
EventLoop, EventLoopProxy, EventLoopWindowTarget, OwnedDisplayHandle,
|
||||
};
|
||||
mod event_loop;
|
||||
|
||||
pub use self::window::Window;
|
||||
|
||||
Reference in New Issue
Block a user