Skip to content

Commit

Permalink
fix(core): build without dialog Cargo features (#1973)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Jun 10, 2021
1 parent cd1a299 commit 49fb3b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-dialog-allowlist..md
@@ -0,0 +1,5 @@
---
"tauri": patch
---

Fixes build without the dialog Cargo features.
6 changes: 3 additions & 3 deletions core/tauri/src/endpoints/dialog.rs
Expand Up @@ -144,12 +144,12 @@ fn set_default_path(
}
}

#[cfg(windows)]
#[cfg(all(windows, any(dialog_open, dialog_save)))]
struct WindowParent {
hwnd: *mut std::ffi::c_void,
}

#[cfg(windows)]
#[cfg(all(windows, any(dialog_open, dialog_save)))]
unsafe impl raw_window_handle::HasRawWindowHandle for WindowParent {
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
let mut handle = raw_window_handle::windows::WindowsHandle::empty();
Expand All @@ -158,7 +158,7 @@ unsafe impl raw_window_handle::HasRawWindowHandle for WindowParent {
}
}

#[cfg(windows)]
#[cfg(all(windows, any(dialog_open, dialog_save)))]
fn parent<P: Params>(window: Window<P>) -> crate::Result<WindowParent> {
Ok(WindowParent {
hwnd: window.hwnd()?,
Expand Down

0 comments on commit 49fb3b7

Please sign in to comment.