MCPcopy Create free account
hub / github.com/GCWing/BitFun / minimize_to_tray

Function minimize_to_tray

src/apps/desktop/src/api/system_api.rs:443–455  ·  view source on GitHub ↗
(
    app: tauri::AppHandle,
    startup_trace: State<'_, DesktopStartupTrace>,
)

Source from the content-addressed store, hash-verified

441/// dialog when the user chooses to minimize instead of quitting).
442#[tauri::command]
443pub async fn minimize_to_tray(
444 app: tauri::AppHandle,
445 startup_trace: State<'_, DesktopStartupTrace>,
446) -> Result<(), String> {
447 if let Err(error) = crate::tray::setup_tray(&app, &startup_trace) {
448 log::warn!("Failed to initialize tray before minimizing: {}", error);
449 }
450 if let Some(window) = app.get_webview_window("main") {
451 window.hide().map_err(|e| e.to_string())?;
452 log::info!("Main window minimized to tray via command");
453 }
454 Ok(())
455}
456
457/// Initialize the desktop tray after the startup shell has become interactive.
458#[tauri::command]

Callers

nothing calls this directly

Calls 2

setup_trayFunction · 0.85
hideMethod · 0.45

Tested by

no test coverage detected