Files
agent/apps/desktop/src-tauri/src/lib.rs

31 lines
834 B
Rust
Raw Normal View History

#[cfg(windows)]
use tauri::Manager;
#[cfg(windows)]
mod windows_appbar;
2026-07-18 16:44:11 +08:00
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_opener::init())
.setup(|app| {
#[cfg(windows)]
{
let window = app
.get_webview_window("main")
.expect("main window must be configured");
windows_appbar::register_right_edge(window.hwnd()?)?;
}
Ok(())
})
.build(tauri::generate_context!())
.expect("failed to build SenlinAI desktop app")
.run(|_, event| {
#[cfg(windows)]
if matches!(event, tauri::RunEvent::ExitRequested { .. }) {
windows_appbar::unregister();
}
});
2026-07-18 16:44:11 +08:00
}