Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: don't implicitly activate background apps #3997

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/platform_impl/apple/appkit/app_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,16 @@ impl AppState {
// menu bar is initially unresponsive on macOS 10.15.
// If no activation policy is explicitly provided, do not set it at all
// to allow the package manifest to define behavior via LSUIElement.
if self.activation_policy.is_some() {
app.setActivationPolicy(self.activation_policy.unwrap());
if let Some(activation_policy) = self.activation_policy {
app.setActivationPolicy(activation_policy);
}

#[allow(deprecated)]
app.activateIgnoringOtherApps(self.activate_ignoring_other_apps);
if self.activate_ignoring_other_apps
&& self.activation_policy != Some(NSApplicationActivationPolicy::Prohibited)
{
#[allow(deprecated)]
app.activateIgnoringOtherApps(true);
}

if self.default_menu {
// The menubar initialization should be before the `NewEvents` event, to allow
Expand Down
Loading