Skip to content

Commit

Permalink
fix: use activateIgnoringOtherApps on older macOS versions
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Oct 14, 2024
1 parent 101973c commit 357b927
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/crash-macos-below-14.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wry": "patch:bug"
---

Fix crash on macOS versions below 14.
6 changes: 5 additions & 1 deletion src/wkwebview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,11 @@ r#"Object.defineProperty(window, 'ipc', {

// make sure the window is always on top when we create a new webview
let app = NSApplication::sharedApplication(mtm);
NSApplication::activate(&app);
if os_version.0 >= 14 {
NSApplication::activate(&app);
} else {
NSApplication::activateIgnoringOtherApps(&app, true);
}
}

#[cfg(target_os = "ios")]
Expand Down

0 comments on commit 357b927

Please sign in to comment.