fix Windows build?
This commit is contained in:
parent
1b53bc1bc7
commit
ef607db260
1 changed files with 12 additions and 10 deletions
|
|
@ -99,17 +99,19 @@ pub fn run() {
|
||||||
.on_window_event(|window, event| match event {
|
.on_window_event(|window, event| match event {
|
||||||
tauri::WindowEvent::CloseRequested { api, .. } => {
|
tauri::WindowEvent::CloseRequested { api, .. } => {
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
let res = window
|
{
|
||||||
.app_handle()
|
let res = window
|
||||||
.set_activation_policy(tauri::ActivationPolicy::Accessory);
|
.app_handle()
|
||||||
if let Err(e) = res {
|
.set_activation_policy(tauri::ActivationPolicy::Accessory);
|
||||||
println!("Failed to set activation policy: {}", e);
|
if let Err(e) = res {
|
||||||
|
println!("Failed to set activation policy: {}", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
api.prevent_close();
|
||||||
|
|
||||||
|
// TODO may be different on windows, this works for macos
|
||||||
|
tauri::AppHandle::hide(window.app_handle()).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
api.prevent_close();
|
|
||||||
|
|
||||||
// TODO may be different on windows, this works for macos
|
|
||||||
tauri::AppHandle::hide(window.app_handle()).unwrap();
|
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue