Skip to content

Commit a41bdbd

Browse files
committed
fix: 修复特定平台不兼容导致的编译问题
1 parent 931ffb3 commit a41bdbd

File tree

1 file changed

+6
-5
lines changed
  • template-creator/src-tauri/src

1 file changed

+6
-5
lines changed

template-creator/src-tauri/src/main.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn main() {
4444
app_handle.get_window("about").unwrap().set_focus().unwrap();
4545
return;
4646
}
47-
tauri::WindowBuilder::new(
47+
let mut new_window = tauri::WindowBuilder::new(
4848
&app_handle,
4949
"about",
5050
tauri::WindowUrl::App("about.html".into()),
@@ -56,10 +56,11 @@ fn main() {
5656
.focused(true)
5757
.max_inner_size(500.0, 400.0)
5858
.min_inner_size(500.0, 400.0)
59-
.owner_window(event.window().hwnd().unwrap())
60-
.center()
61-
.build()
62-
.unwrap();
59+
.center();
60+
if cfg!(target_os = "windows") {
61+
new_window = new_window.owner_window(event.window().hwnd().unwrap())
62+
}
63+
new_window.build().unwrap();
6364
}
6465
"help_toggle_devtools" => {
6566
let event_win = event.window();

0 commit comments

Comments
 (0)