From 7d56109ecbc41201e4365832074df7a9933c6ee4 Mon Sep 17 00:00:00 2001 From: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta Date: Sat, 1 Aug 2026 22:24:18 -0400 Subject: [PATCH] chore(desktop): keep app entrypoint within size budget Co-authored-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta Signed-off-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta --- desktop/src-tauri/src/lib.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/desktop/src-tauri/src/lib.rs b/desktop/src-tauri/src/lib.rs index b6627bca0..b6e9f6f52 100644 --- a/desktop/src-tauri/src/lib.rs +++ b/desktop/src-tauri/src/lib.rs @@ -75,10 +75,8 @@ use tauri::{Listener, WindowEvent}; use tauri_plugin_window_state::StateFlags; #[cfg(target_os = "macos")] use tray_menu::show_main_window; - #[cfg(target_os = "macos")] const INITIAL_RENDER_READY_EVENT: &str = "initial-render-ready"; - fn reveal_initial_window(window: &tauri::Window) { if let Err(error) = window.show() { eprintln!("buzz-desktop: failed to reveal main window: {error}"); @@ -88,7 +86,6 @@ fn reveal_initial_window(window: &tauri::Window) { eprintln!("buzz-desktop: failed to focus main window: {error}"); } } - #[cfg(target_os = "macos")] fn set_initial_window_backing(window: &tauri::Window) { // The window remains transparent at runtime for vibrancy. Use an opaque @@ -98,7 +95,6 @@ fn set_initial_window_backing(window: &tauri::Window) { eprintln!("buzz-desktop: failed to set initial window backing: {error}"); } } - #[cfg(target_os = "macos")] async fn clear_initial_window_backing(window: &tauri::Window) { tokio::time::sleep(std::time::Duration::from_millis(250)).await; @@ -106,15 +102,12 @@ async fn clear_initial_window_backing(window: &tauri::Window< eprintln!("buzz-desktop: failed to clear initial window backing: {error}"); } } - #[cfg(target_os = "macos")] async fn wait_for_stable_initial_window_geometry(window: &tauri::Window) { const MAX_POLLS: usize = 120; const REQUIRED_STABLE_POLLS: usize = 4; - let mut previous_bounds = None; let mut stable_polls = 0; - for _ in 0..MAX_POLLS { // Accept whatever geometry the window-state plugin restores — maximized // or a normal saved size. macOS applies the restore asynchronously, so @@ -126,7 +119,6 @@ async fn wait_for_stable_initial_window_geometry(window: &tau (Ok(position), Ok(size)) => Some((position.x, position.y, size.width, size.height)), _ => None, }; - if bounds.is_some() && bounds == previous_bounds { stable_polls += 1; if stable_polls >= REQUIRED_STABLE_POLLS { @@ -136,13 +128,10 @@ async fn wait_for_stable_initial_window_geometry(window: &tau stable_polls = 0; } previous_bounds = bounds; - tokio::time::sleep(std::time::Duration::from_millis(16)).await; } - eprintln!("buzz-desktop: initial window geometry did not settle before reveal timeout"); } - #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { // mesh-llm's async chains (model download, node start/join) overflow @@ -172,7 +161,6 @@ pub fn run() { eprintln!("buzz-mesh: failed to build big-stack tokio runtime, using default: {error}"); } } - let builder = tauri::Builder::default() .plugin(tauri_plugin_single_instance::init(|app, argv, _cwd| { // Focus the existing window when a duplicate instance launches.