Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/remove-drag-drop-feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
wry: minor
---

Removed `drag-drop` feature, previously gated `WebViewAttributes::drag_drop_handler` and `WebViewBuilder::with_drag_drop_handler` are now always available
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@ exclude = ["/.changes", "/.github", "/audits", "/wry-logo.svg"]

[package.metadata.docs.rs]
no-default-features = true
features = ["drag-drop", "protocol", "os-webview"]
features = ["protocol", "os-webview"]
targets = [
"x86_64-unknown-linux-gnu",
"x86_64-pc-windows-msvc",
"x86_64-apple-darwin",
]

[features]
default = ["drag-drop", "protocol", "os-webview", "x11"]
default = ["protocol", "os-webview", "x11"]
serde = ["dpi/serde"]
drag-drop = []
protocol = []
devtools = []
transparent = []
Expand Down
1 change: 0 additions & 1 deletion examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ fn main() -> wry::Result<()> {
wry::NewWindowResponse::Allow
});

#[cfg(feature = "drag-drop")]
let builder = builder.with_drag_drop_handler(|e| {
match e {
wry::DragDropEvent::Enter { paths, position } => {
Expand Down
6 changes: 0 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,11 +655,7 @@ pub struct WebViewAttributes<'a> {
///
/// Note, that if you do block this behavior, it won't be possible to drop files on `<input type="file">` forms.
/// Also note, that it's not possible to manually set the value of a `<input type="file">` via JavaScript for security reasons.
#[cfg(feature = "drag-drop")]
#[cfg_attr(docsrs, doc(cfg(feature = "drag-drop")))]
pub drag_drop_handler: Option<Box<dyn Fn(DragDropEvent) -> bool>>,
#[cfg(not(feature = "drag-drop"))]
drag_drop_handler: Option<Box<dyn Fn(DragDropEvent) -> bool>>,

/// A navigation handler to decide if incoming url is allowed to navigate.
///
Expand Down Expand Up @@ -1167,8 +1163,6 @@ impl<'a> WebViewBuilder<'a> {
///
/// Note, that if you do block this behavior, it won't be possible to drop files on `<input type="file">` forms.
/// Also note, that it's not possible to manually set the value of a `<input type="file">` via JavaScript for security reasons.
#[cfg(feature = "drag-drop")]
#[cfg_attr(docsrs, doc(cfg(feature = "drag-drop")))]
pub fn with_drag_drop_handler<F>(mut self, handler: F) -> Self
where
F: Fn(DragDropEvent) -> bool + 'static,
Expand Down
Loading