Skip to content

Commit

Permalink
Add HasRawWindowHandle for WindowHandle in druid
Browse files Browse the repository at this point in the history
Expose the `HasRawWindowHandle` trait impl of druid-shell for
`WindowHandle` into druid itself, so druid users can access it. This
is also under a `raw-win-handle` feature, like the druid-shell one.

Bug: #1505
  • Loading branch information
djeedai committed Jun 20, 2021
1 parent dfd105e commit cf856b1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions druid-shell/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ pub use image;
pub use kurbo;
pub use piet_common as piet;

// Reexport the version of `raw_window_handle` we are using.
#[cfg(feature = "raw-win-handle")]
pub use raw_window_handle;

#[macro_use]
mod util;

Expand Down
3 changes: 3 additions & 0 deletions druid/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ x11 = ["druid-shell/x11"]
crochet = []
serde = ["im/serde"]

# Implement HasRawWindowHandle for WindowHandle
raw-win-handle = ["druid-shell/raw-win-handle"]

# passing on all the image features. AVIF is not supported because it does not
# support decoding, and that's all we use `Image` for.
png = ["druid-shell/image_png"]
Expand Down
3 changes: 3 additions & 0 deletions druid/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ pub use shell::{
WindowHandle, WindowLevel, WindowState,
};

#[cfg(feature = "raw-win-handle")]
pub use crate::shell::raw_window_handle::{HasRawWindowHandle, RawWindowHandle};

pub use crate::core::WidgetPod;
pub use app::{AppLauncher, WindowConfig, WindowDesc, WindowSizePolicy};
pub use app_delegate::{AppDelegate, DelegateCtx};
Expand Down

0 comments on commit cf856b1

Please sign in to comment.