diff --git a/core/tauri-runtime-wry/src/lib.rs b/core/tauri-runtime-wry/src/lib.rs index bfeb6f5d77f..c96d2134b1a 100644 --- a/core/tauri-runtime-wry/src/lib.rs +++ b/core/tauri-runtime-wry/src/lib.rs @@ -83,8 +83,7 @@ use wry::webview::{ use tauri_runtime::ActivationPolicy; #[cfg(target_os = "macos")] pub use wry::application::platform::macos::{ - ActivationPolicy as WryActivationPolicy, CustomMenuItemExtMacOS, EventLoopExtMacOS, - WindowExtMacOS, + ActivationPolicy as WryActivationPolicy, EventLoopExtMacOS, WindowExtMacOS, }; use std::{ @@ -546,7 +545,7 @@ impl std::fmt::Debug for WindowBuilderWrapper { s.field("inner", &self.inner).field("center", &self.center); #[cfg(target_os = "macos")] { - s = s.field("tabbing_identifier", &self.tabbing_identifier); + s.field("tabbing_identifier", &self.tabbing_identifier); } s.finish() } @@ -2537,6 +2536,8 @@ fn create_webview( target_os = "openbsd" ))] let _ = menu.init_for_gtk_window(window.gtk_window()); + #[cfg(target_os = "macos")] + menu.init_for_nsapp(); } webview_id_map.insert(window.id(), window_id); diff --git a/core/tauri/src/app.rs b/core/tauri/src/app.rs index 5ce535b8b64..37e9dac99ed 100644 --- a/core/tauri/src/app.rs +++ b/core/tauri/src/app.rs @@ -1419,7 +1419,7 @@ impl Builder { R::new(runtime_args)? }; #[cfg(not(any(windows, target_os = "linux")))] - let mut runtime = R::new()?; + let mut runtime = R::new(runtime_args)?; #[cfg(target_os = "macos")] if let Some(menu) = menu { diff --git a/core/tauri/src/lib.rs b/core/tauri/src/lib.rs index ff60ef770c1..fd4340dab4e 100644 --- a/core/tauri/src/lib.rs +++ b/core/tauri/src/lib.rs @@ -161,7 +161,7 @@ pub use tauri_runtime_wry::webview_version; #[cfg(target_os = "macos")] #[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))] -pub use runtime::{menu::NativeImage, ActivationPolicy}; +pub use runtime::ActivationPolicy; #[cfg(target_os = "macos")] pub use self::utils::TitleBarStyle; diff --git a/core/tauri/src/menu.rs b/core/tauri/src/menu.rs index 7cd3c7c1499..b53b612f6db 100644 --- a/core/tauri/src/menu.rs +++ b/core/tauri/src/menu.rs @@ -4,7 +4,6 @@ //! Menu types and utility functions -use tauri_runtime::menu::builders::AboutMetadataBuilder; use tauri_utils::config::Config; pub use crate::runtime::menu::*; @@ -14,12 +13,13 @@ pub use crate::runtime::menu::*; /// Creates a menu filled with default menu items and submenus. pub fn default(config: &Config) -> Menu { - let about_metadata = AboutMetadataBuilder::new() - .name(config.package.product_name.clone()) - .version(config.package.version.clone()) - .copyright(config.tauri.bundle.copyright.clone()) - .authors(config.tauri.bundle.publisher.clone().map(|p| vec![p])) - .build(); + let about_metadata = AboutMetadata { + name: config.package.product_name.clone(), + version: config.package.version.clone(), + copyright: config.tauri.bundle.copyright.clone(), + authors: config.tauri.bundle.publisher.clone().map(|p| vec![p]), + ..Default::default() + }; Menu::with_items(&[ #[cfg(target_os = "macos")] @@ -27,7 +27,7 @@ pub fn default(config: &Config) -> Menu { config.package.binary_name().unwrap_or_default(), true, &[ - &PredefinedMenuItem::about(None, Some(about_metadata)), + &PredefinedMenuItem::about(None, Some(about_metadata.clone())), &PredefinedMenuItem::separator(), &PredefinedMenuItem::services(None), &PredefinedMenuItem::separator(), diff --git a/core/tauri/src/window.rs b/core/tauri/src/window.rs index 94c7dabfff3..ffee290daa3 100644 --- a/core/tauri/src/window.rs +++ b/core/tauri/src/window.rs @@ -1117,6 +1117,8 @@ impl Window { { let _ = menu.remove_for_gtk_window(&self.gtk_window()?); } + #[cfg(target_os = "macos")] + menu.remove_for_nsapp(); } let prev_menu = current_menu.take().map(|m| m.1);