diff --git a/crates/gitbutler-tauri/src/main.rs b/crates/gitbutler-tauri/src/main.rs index 4c177d6f38..0a118d7405 100644 --- a/crates/gitbutler-tauri/src/main.rs +++ b/crates/gitbutler-tauri/src/main.rs @@ -51,6 +51,20 @@ fn main() { ) .expect("Failed to create window"); + #[cfg(target_os = "macos")] + use tauri::LogicalPosition; + #[cfg(target_os = "macos")] + use tauri_plugin_traffic_lights::WindowExt; + #[cfg(target_os = "macos")] + // NOTE: Make sure you only call this ONCE per window. + { + if let Some(window) = tauri_app.get_window("main") { + #[cfg(target_os = "macos")] + // NOTE: Make sure you only call this ONCE per window. + window.setup_traffic_lights_inset(LogicalPosition::new(18.0, 22.0))?; + }; + } + // TODO(mtsgrd): Is there a better way to disable devtools in E2E tests? #[cfg(debug_assertions)] if tauri_app.config().product_name != Some("GitButler Test".to_string()) { @@ -106,7 +120,7 @@ fn main() { app_handle.manage(WindowState::new(app_handle.clone())); - let mut app_settings = AppSettingsWithDiskSync::new(config_dir)?; + let mut app_settings = AppSettingsWithDiskSync::new(config_dir.clone())?; app_settings.watch_in_background({ let app_handle = app_handle.clone(); move |app_settings| { @@ -133,7 +147,15 @@ fn main() { menu::handle_event(&window.clone(), &event) }); - if app_settings.feature_flags.v3 { + let mut app_settings = AppSettingsWithDiskSync::new(config_dir)?; + app_settings.watch_in_background({ + let app_handle = app_handle.clone(); + move |app_settings| { + gitbutler_tauri::ChangeForFrontend::from(app_settings).send(&app_handle) + } + })?; + + if app_settings.get()?.clone().feature_flags.v3 { #[cfg(target_os = "macos")] use tauri::LogicalPosition; #[cfg(target_os = "macos")]