Skip to content

Commit

Permalink
feat: re-export entire raw_window_handle module instead of `HasRawW…
Browse files Browse the repository at this point in the history
…indowHandle` trait

Signed-off-by: rhysd <[email protected]>
  • Loading branch information
rhysd committed Nov 10, 2023
1 parent e00b6d4 commit 129575c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .changes/rwh.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Refactor new method to take raw window handle instead. Following are APIs got af
- Position field in `FileDrop` event is now `Position` instead of `PhysicalPosition`. Users need to handle scale factor
depend on the situation they have.
- `Webview::inner_size` is removed.
- `HasRawWindowHandle` trait is re-exported as `wry::HasRawWindowHandle`.
- [raw-window-handle](https://docs.rs/raw-window-handle/latest/raw_window_handle/) crate is re-exported as `wry::raw_window_handle`.

This also means that we removed `tao` as a dependency completely which required some changes to the Android backend:
- We exposed the `android_setup` function that needs to be called once to setup necessary logic.
Expand Down
10 changes: 6 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//! This example leverages the [`HasRawWindowHandle`] and supports Windows, macOS, iOS, Android and Linux (X11 Only)
//!
//! ```no_run
//! use wry::WebViewBuilder;
//! use wry::{WebViewBuilder, raw_window_handle};
//!
//! # struct T;
//! # unsafe impl raw_window_handle::HasRawWindowHandle for T {
Expand Down Expand Up @@ -67,7 +67,7 @@
//! macOS, Windows and Linux (X11 Only).
//!
//! ```no_run
//! use wry::WebViewBuilder;
//! use wry::{WebViewBuilder, raw_window_handle};
//!
//! # struct T;
//! # unsafe impl raw_window_handle::HasRawWindowHandle for T {
Expand Down Expand Up @@ -198,7 +198,9 @@ use android::*;
target_os = "openbsd"
))]
pub(crate) mod webkitgtk;
pub use raw_window_handle::HasRawWindowHandle;
/// Re-exported [raw-window-handle](https://docs.rs/raw-window-handle/latest/raw_window_handle/) crate.
pub use raw_window_handle;
use raw_window_handle::HasRawWindowHandle;
#[cfg(any(
target_os = "linux",
target_os = "dragonfly",
Expand Down Expand Up @@ -725,7 +727,7 @@ impl<'a> WebViewBuilder<'a> {
/// # Examples
///
/// ```no_run
/// use wry::WebViewBuilder;
/// use wry::{WebViewBuilder, raw_window_handle};
///
/// # struct T;
/// # unsafe impl raw_window_handle::HasRawWindowHandle for T {
Expand Down

0 comments on commit 129575c

Please sign in to comment.