Implement From<u64> for WindowId and vise-versa
This should help downstream applications to expose WindowId to the end users via e.g. IPC to control particular windows in multi window systems.
This commit is contained in:
parent
c55d97183d
commit
cb41c58f21
14 changed files with 115 additions and 60 deletions
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
use sctk::reexports::client::protocol::wl_surface::WlSurface;
|
||||
|
||||
pub use crate::platform_impl::platform::WindowId;
|
||||
pub use event_loop::{EventLoop, EventLoopProxy, EventLoopWindowTarget};
|
||||
pub use output::{MonitorHandle, VideoMode};
|
||||
pub use window::Window;
|
||||
|
|
@ -27,16 +28,7 @@ impl DeviceId {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct WindowId(usize);
|
||||
|
||||
impl WindowId {
|
||||
pub const unsafe fn dummy() -> Self {
|
||||
WindowId(0)
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn make_wid(surface: &WlSurface) -> WindowId {
|
||||
WindowId(surface.as_ref().c_ptr() as usize)
|
||||
WindowId(surface.as_ref().c_ptr() as u64)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue