Skip to content

Commit 49fb3b7

Browse files
authored
fix(core): build without dialog Cargo features (#1973)
1 parent cd1a299 commit 49fb3b7

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

.changes/fix-dialog-allowlist..md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch
3+
---
4+
5+
Fixes build without the dialog Cargo features.

core/tauri/src/endpoints/dialog.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ fn set_default_path(
144144
}
145145
}
146146

147-
#[cfg(windows)]
147+
#[cfg(all(windows, any(dialog_open, dialog_save)))]
148148
struct WindowParent {
149149
hwnd: *mut std::ffi::c_void,
150150
}
151151

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

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

0 commit comments

Comments
 (0)