fix(core): build without dialog Cargo features (#1973)

This commit is contained in:
Lucas Fernandes Nogueira 2021-06-09 22:22:26 -03:00 committed by GitHub
parent cd1a299a7d
commit 49fb3b7225
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -0,0 +1,5 @@
---
"tauri": patch
---
Fixes build without the dialog Cargo features.

View File

@ -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();
@ -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()?,