|
|
@ -145,10 +145,12 @@ pub fn run() {
|
|
|
|
|
|
|
|
|
|
|
|
app.run(move |_app_handle, _event| {
|
|
|
|
app.run(move |_app_handle, _event| {
|
|
|
|
#[cfg(desktop)]
|
|
|
|
#[cfg(desktop)]
|
|
|
|
if let RunEvent::ExitRequested { api, .. } = &_event {
|
|
|
|
if let RunEvent::ExitRequested { code, api, .. } = &_event {
|
|
|
|
// Keep the event loop running even if all windows are closed
|
|
|
|
if code.is_none() {
|
|
|
|
// This allow us to catch system tray events when there is no window
|
|
|
|
// Keep the event loop running even if all windows are closed
|
|
|
|
api.prevent_exit();
|
|
|
|
// This allow us to catch system tray events when there is no window
|
|
|
|
|
|
|
|
api.prevent_exit();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|