Skip to content

Commit a51e19e

Browse files
djeedaicmyr
authored andcommitted
Add HasRawWindowHandle for WindowHandle in druid
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
1 parent 71faaea commit a51e19e

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ You can find its changes [documented below](#070---2021-01-01).
5151
- Linux extension: primary_clipboard ([#1843] by [@Maan2003])
5252
- x11: Implement primary_clipboard ([#1867] by [@psychon])
5353
- x11: Set WM_CLASS property ([#1868] by [@psychon])
54+
- Expose `RawWindowHandle` for `WindowHandle` under the `raw-win-handle` feature ([#1828] by [@djeedai])
5455

5556
### Changed
5657

@@ -751,6 +752,7 @@ Last release without a changelog :(
751752
[#1805]: https://github.com/linebender/druid/pull/1805
752753
[#1820]: https://github.com/linebender/druid/pull/1820
753754
[#1825]: https://github.com/linebender/druid/pull/1825
755+
[#1828]: https://github.com/linebender/druid/pull/1828
754756
[#1843]: https://github.com/linebender/druid/pull/1843
755757
[#1850]: https://github.com/linebender/druid/pull/1850
756758
[#1851]: https://github.com/linebender/druid/pull/1851

druid-shell/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ pub use image;
4343
pub use kurbo;
4444
pub use piet_common as piet;
4545

46+
// Reexport the version of `raw_window_handle` we are using.
47+
#[cfg(feature = "raw-win-handle")]
48+
pub use raw_window_handle;
49+
4650
#[macro_use]
4751
mod util;
4852

druid/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ x11 = ["druid-shell/x11"]
2828
crochet = []
2929
serde = ["im/serde", "druid-shell/serde"]
3030

31+
# Implement HasRawWindowHandle for WindowHandle
32+
raw-win-handle = ["druid-shell/raw-win-handle"]
33+
3134
# passing on all the image features. AVIF is not supported because it does not
3235
# support decoding, and that's all we use `Image` for.
3336
png = ["druid-shell/image_png"]

druid/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ pub use shell::{
188188
WindowHandle, WindowLevel, WindowState,
189189
};
190190

191+
#[cfg(feature = "raw-win-handle")]
192+
pub use crate::shell::raw_window_handle::{HasRawWindowHandle, RawWindowHandle};
193+
191194
pub use crate::core::WidgetPod;
192195
pub use app::{AppLauncher, WindowConfig, WindowDesc, WindowSizePolicy};
193196
pub use app_delegate::{AppDelegate, DelegateCtx};

0 commit comments

Comments
 (0)