diff --git a/.changes/crash-macos-below-14.md b/.changes/crash-macos-below-14.md new file mode 100644 index 000000000..152abdf2e --- /dev/null +++ b/.changes/crash-macos-below-14.md @@ -0,0 +1,5 @@ +--- +"wry": "patch:bug" +--- + +Fix crash on macOS versions below 14. diff --git a/src/wkwebview/mod.rs b/src/wkwebview/mod.rs index 5a9735f5e..8fd3b96fc 100644 --- a/src/wkwebview/mod.rs +++ b/src/wkwebview/mod.rs @@ -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")]