Skip to content

Commit

Permalink
fix(core): fileDropEnabled option is not working when creating a new …
Browse files Browse the repository at this point in the history
…WebviewWindow (#4146)
  • Loading branch information
TomScavo committed May 17, 2022
1 parent 8e1daad commit 706fcbd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-window-file-drop-enabled.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri": patch
---

Fixes `fileDropEnabled` option not working.
5 changes: 5 additions & 0 deletions core/tauri/src/endpoints/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,13 @@ impl Cmd {
) -> super::Result<()> {
let label = options.label.clone();
let url = options.url.clone();
let file_drop_enabled = options.file_drop_enabled;

let mut builder = crate::window::Window::builder(&context.window, label, url);
if !file_drop_enabled {
builder = builder.disable_file_drop_handler();
}

builder.window_builder =
<<R::Dispatcher as Dispatch<crate::EventLoopMessage>>::WindowBuilder>::with_config(*options);
builder.build().map_err(crate::error::into_anyhow)?;
Expand Down

0 comments on commit 706fcbd

Please sign in to comment.