From 745cfec45e38a3572a99dee456f87360298231eb Mon Sep 17 00:00:00 2001 From: Daniel Collin Date: Fri, 27 Dec 2019 13:26:41 +0100 Subject: [PATCH] Added proper access to HasRawWindowHandle --- src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 59f0aa0..d47d194 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,6 +4,8 @@ //! #![deny(missing_debug_implementations)] +extern crate raw_window_handle; + use std::fmt; use std::os::raw; @@ -91,6 +93,7 @@ pub trait InputCallback { mod error; pub use self::error::Error; pub type Result = std::result::Result; +pub use raw_window_handle::HasRawWindowHandle as HasRawWindowHandle; mod key; pub use key::Key; @@ -134,6 +137,12 @@ impl fmt::Debug for Window { } } +unsafe impl raw_window_handle::HasRawWindowHandle for Window { + fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle { + self.0.raw_window_handle() + } +} + pub fn clamp(low: T, value: T, high: T) -> T { if value < low { low