diff --git a/src/platform_impl/apple/appkit/app_state.rs b/src/platform_impl/apple/appkit/app_state.rs index 6c1769ff3b..35cc8fbd3a 100644 --- a/src/platform_impl/apple/appkit/app_state.rs +++ b/src/platform_impl/apple/appkit/app_state.rs @@ -5,7 +5,7 @@ use std::sync::atomic::{AtomicBool, Ordering as AtomicOrdering}; use std::sync::Arc; use std::time::Instant; -use objc2_app_kit::{NSApplication, NSApplicationActivationPolicy}; +use objc2_app_kit::{NSApplication, NSApplicationActivationPolicy, NSRunningApplication}; use objc2_foundation::{MainThreadMarker, NSNotification}; use super::super::event_handler::EventHandler; @@ -117,6 +117,12 @@ impl AppState { // to allow the package manifest to define behavior via LSUIElement. if self.activation_policy.is_some() { app.setActivationPolicy(self.activation_policy.unwrap()); + } else { + let is_bundle = + unsafe { NSRunningApplication::currentApplication().bundleIdentifier().is_some() }; + if !is_bundle { + app.setActivationPolicy(NSApplicationActivationPolicy::Regular); + } } #[allow(deprecated)]