Skip to content

Commit

Permalink
fix: use activateIgnoringOtherApps on older macOS versions (#1389)
Browse files Browse the repository at this point in the history
* fix: use `activateIgnoringOtherApps` on older macOS versions

closes tauri-apps/tauri#11340

ref: #1316 (comment)

* clippy

---------

Co-authored-by: Lucas Nogueira <[email protected]>
  • Loading branch information
amrbashir and lucasfernog authored Oct 14, 2024
1 parent a57719e commit 33c0193
Show file tree
Hide file tree
Showing 2 changed files with 11 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.
7 changes: 6 additions & 1 deletion src/wkwebview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,12 @@ 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 {
#[allow(deprecated)]
NSApplication::activateIgnoringOtherApps(&app, true);
}
}

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

0 comments on commit 33c0193

Please sign in to comment.