From 239affb1040d146beaeec26e64fdee30a5184b16 Mon Sep 17 00:00:00 2001 From: Tony Date: Tue, 28 Jul 2026 16:37:55 +0800 Subject: [PATCH 1/3] chore(deps): update `objc2-*` crates to 0.3.2 --- .changes/objc2-0.3.2.md | 7 ++ Cargo.lock | 101 +++++++++++-------- crates/tauri-runtime-wry/Cargo.toml | 2 +- crates/tauri-runtime-wry/src/window/macos.rs | 10 +- crates/tauri-runtime/Cargo.toml | 4 +- crates/tauri/Cargo.toml | 8 +- 6 files changed, 77 insertions(+), 55 deletions(-) create mode 100644 .changes/objc2-0.3.2.md diff --git a/.changes/objc2-0.3.2.md b/.changes/objc2-0.3.2.md new file mode 100644 index 000000000000..6759e6395cd5 --- /dev/null +++ b/.changes/objc2-0.3.2.md @@ -0,0 +1,7 @@ +--- +"tauri": patch +"tauri-runtime": patch +"tauri-runtime-wry": patch +--- + +On macOS, updated `objc2-*` dependencies to 0.3.2 diff --git a/Cargo.lock b/Cargo.lock index 3d683731e224..34b4061fcc40 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4838,7 +4838,7 @@ dependencies = [ "objc2 0.6.4", "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.2", "once_cell", "png 0.18.1", "serde", @@ -5263,55 +5263,57 @@ dependencies = [ [[package]] name = "objc2-app-kit" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5906f93257178e2f7ae069efb89fbd6ee94f0592740b5f8a1512ca498814d0fb" +checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" dependencies = [ "bitflags 2.13.0", "block2 0.6.2", "objc2 0.6.4", "objc2-core-foundation", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.2", ] [[package]] name = "objc2-cloud-kit" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c1948a9be5f469deadbd6bcb86ad7ff9e47b4f632380139722f7d9840c0d42c" +checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c" dependencies = [ "bitflags 2.13.0", "objc2 0.6.4", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.2", ] [[package]] name = "objc2-core-data" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f860f8e841f6d32f754836f51e6bc7777cd7e7053cf18528233f6811d3eceb4" +checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa" dependencies = [ "objc2 0.6.4", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.2", ] [[package]] name = "objc2-core-foundation" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daeaf60f25471d26948a1c2f840e3f7d86f4109e3af4e8e4b5cd70c39690d925" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ "bitflags 2.13.0", + "dispatch2", "objc2 0.6.4", ] [[package]] name = "objc2-core-graphics" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dca602628b65356b6513290a21a6405b4d4027b8b250f0b98dddbb28b7de02" +checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" dependencies = [ "bitflags 2.13.0", + "dispatch2", "objc2 0.6.4", "objc2-core-foundation", "objc2-io-surface", @@ -5319,22 +5321,34 @@ dependencies = [ [[package]] name = "objc2-core-image" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ffa6bea72bf42c78b0b34e89c0bafac877d5f80bf91e159a5d96ea7f693ca56" +checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006" dependencies = [ "objc2 0.6.4", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.2", ] [[package]] name = "objc2-core-location" -version = "0.3.0" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca347214e24bc973fc025fd0d36ebb179ff30536ed1f80252706db19ee452009" +dependencies = [ + "objc2 0.6.4", + "objc2-foundation 0.3.2", +] + +[[package]] +name = "objc2-core-text" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d31f4c5b5192304996badc466aeadffe1411d73a9bbd3b18b6b2ee9d048b07bd" +checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" dependencies = [ + "bitflags 2.13.0", "objc2 0.6.4", - "objc2-foundation 0.3.0", + "objc2-core-foundation", + "objc2-core-graphics", ] [[package]] @@ -5366,9 +5380,9 @@ dependencies = [ [[package]] name = "objc2-foundation" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a21c6c9014b82c39515db5b396f91645182611c97d24637cf56ac01e5f8d998" +checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" dependencies = [ "bitflags 2.13.0", "block2 0.6.2", @@ -5378,9 +5392,9 @@ dependencies = [ [[package]] name = "objc2-io-surface" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "161a8b87e32610086e1a7a9e9ec39f84459db7b3a0881c1f16ca5a2605581c19" +checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" dependencies = [ "bitflags 2.13.0", "objc2 0.6.4", @@ -5414,21 +5428,21 @@ dependencies = [ [[package]] name = "objc2-quartz-core" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb3794501bb1bee12f08dcad8c61f2a5875791ad1c6f47faa71a0f033f20071" +checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" dependencies = [ "bitflags 2.13.0", "objc2 0.6.4", "objc2-core-foundation", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.2", ] [[package]] name = "objc2-ui-kit" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777a571be14a42a3990d4ebedaeb8b54cd17377ec21b92e8200ac03797b3bee1" +checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" dependencies = [ "bitflags 2.13.0", "block2 0.6.2", @@ -5439,33 +5453,34 @@ dependencies = [ "objc2-core-graphics", "objc2-core-image", "objc2-core-location", - "objc2-foundation 0.3.0", - "objc2-quartz-core 0.3.0", + "objc2-core-text", + "objc2-foundation 0.3.2", + "objc2-quartz-core 0.3.2", "objc2-user-notifications", ] [[package]] name = "objc2-user-notifications" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670fe793adbf3b5e93686d48a05a7ed7ee53dfa65d106ced4805fae8969059b2" +checksum = "9df9128cbbfef73cda168416ccf7f837b62737d748333bfe9ab71c245d76613e" dependencies = [ "objc2 0.6.4", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.2", ] [[package]] name = "objc2-web-kit" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b717127e4014b0f9f3e8bba3d3f2acec81f1bde01f656823036e823ed2c94dce" +checksum = "b2e5aaab980c433cf470df9d7af96a7b46a9d892d521a2cbbb2f8a4c16751e7f" dependencies = [ "bitflags 2.13.0", "block2 0.6.2", "objc2 0.6.4", "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.2", ] [[package]] @@ -8912,7 +8927,7 @@ dependencies = [ "ndk-sys", "objc2 0.6.4", "objc2-app-kit", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.2", "objc2-ui-kit", "once_cell", "parking_lot", @@ -8987,7 +9002,7 @@ dependencies = [ "muda", "objc2 0.6.4", "objc2-app-kit", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.2", "objc2-ui-kit", "objc2-web-kit", "percent-encoding", @@ -9306,7 +9321,7 @@ dependencies = [ "fern", "log", "objc2 0.6.4", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.2", "serde", "serde_json", "serde_repr", @@ -9951,7 +9966,7 @@ dependencies = [ "objc2-app-kit", "objc2-core-foundation", "objc2-core-graphics", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.2", "once_cell", "png 0.18.1", "serde", @@ -10765,7 +10780,7 @@ dependencies = [ "objc2 0.6.4", "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.2", "raw-window-handle", "windows-sys 0.59.0", "windows-version", @@ -11361,7 +11376,7 @@ dependencies = [ "objc2 0.6.4", "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.0", + "objc2-foundation 0.3.2", "objc2-ui-kit", "objc2-web-kit", "once_cell", diff --git a/crates/tauri-runtime-wry/Cargo.toml b/crates/tauri-runtime-wry/Cargo.toml index 7c576dea5ec2..e0485cccb70b 100644 --- a/crates/tauri-runtime-wry/Cargo.toml +++ b/crates/tauri-runtime-wry/Cargo.toml @@ -45,7 +45,7 @@ percent-encoding = "2" objc2 = "0.6" [target.'cfg(target_os = "macos")'.dependencies] -objc2-app-kit = { version = "0.3", default-features = false, features = [ +objc2-app-kit = { version = "0.3.2", default-features = false, features = [ "block2", "NSApplication", "NSResponder", diff --git a/crates/tauri-runtime-wry/src/window/macos.rs b/crates/tauri-runtime-wry/src/window/macos.rs index 6bb16ce3e5f1..4a1d9a360599 100644 --- a/crates/tauri-runtime-wry/src/window/macos.rs +++ b/crates/tauri-runtime-wry/src/window/macos.rs @@ -24,16 +24,16 @@ impl super::WindowExt for tao::window::Window { false, ) }; - unsafe { sheet.setAlphaValue(0.5) }; - unsafe { ns_window.beginSheet_completionHandler(&sheet, None) }; - } else if let Some(attached) = unsafe { ns_window.attachedSheet() } { - unsafe { ns_window.endSheet(&attached) }; + sheet.setAlphaValue(0.5); + ns_window.beginSheet_completionHandler(&sheet, None); + } else if let Some(attached) = ns_window.attachedSheet() { + ns_window.endSheet(&attached); } } fn is_enabled(&self) -> bool { let ns_window: &NSWindow = unsafe { &*self.ns_window().cast() }; - unsafe { ns_window.attachedSheet() }.is_none() + ns_window.attachedSheet().is_none() } fn center(&self) { diff --git a/crates/tauri-runtime/Cargo.toml b/crates/tauri-runtime/Cargo.toml index c2c54cccc519..3ecbdc5005b7 100644 --- a/crates/tauri-runtime/Cargo.toml +++ b/crates/tauri-runtime/Cargo.toml @@ -51,7 +51,7 @@ jni = "0.21" [target.'cfg(all(target_vendor = "apple", not(target_os = "macos")))'.dependencies] objc2 = "0.6" -objc2-ui-kit = { version = "0.3.0", default-features = false, features = [ +objc2-ui-kit = { version = "0.3.2", default-features = false, features = [ "UIView", "UIResponder", "UIScene", @@ -61,7 +61,7 @@ objc2-ui-kit = { version = "0.3.0", default-features = false, features = [ [target."cfg(target_os = \"macos\")".dependencies] url = "2" objc2 = "0.6" -objc2-web-kit = { version = "0.3", default-features = false, features = [ +objc2-web-kit = { version = "0.3.2", default-features = false, features = [ "objc2-app-kit", "WKWebView", "WKWebViewConfiguration", diff --git a/crates/tauri/Cargo.toml b/crates/tauri/Cargo.toml index 3f1dd5f82e2d..88e778b63870 100644 --- a/crates/tauri/Cargo.toml +++ b/crates/tauri/Cargo.toml @@ -109,12 +109,12 @@ objc2 = "0.6" [target.'cfg(target_os = "macos")'.dependencies] embed_plist = "1.2" plist = "1" -objc2-foundation = { version = "0.3", default-features = false, features = [ +objc2-foundation = { version = "0.3.2", default-features = false, features = [ "std", "NSData", "NSThread", ] } -objc2-app-kit = { version = "0.3", default-features = false, features = [ +objc2-app-kit = { version = "0.3.2", default-features = false, features = [ "std", "NSApplication", "NSColor", @@ -123,7 +123,7 @@ objc2-app-kit = { version = "0.3", default-features = false, features = [ "NSWindow", "NSImage", ] } -objc2-web-kit = { version = "0.3", default-features = false, features = [ +objc2-web-kit = { version = "0.3.2", default-features = false, features = [ "objc2-app-kit", "WKWebView", "WKWebViewConfiguration", @@ -160,7 +160,7 @@ jni = "0.21" [target.'cfg(all(target_vendor = "apple", not(target_os = "macos")))'.dependencies] libc = "0.2" swift-rs = "1" -objc2-ui-kit = { version = "0.3.0", default-features = false, features = [ +objc2-ui-kit = { version = "0.3.2", default-features = false, features = [ "UIApplication", "UIResponder", "UIView", From aa5b0244f2fee06934c232bf24484d8cdd9a482b Mon Sep 17 00:00:00 2001 From: Tony Date: Tue, 28 Jul 2026 16:39:18 +0800 Subject: [PATCH 2/3] change tag --- .changes/objc2-0.3.2.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.changes/objc2-0.3.2.md b/.changes/objc2-0.3.2.md index 6759e6395cd5..83c6cffcb400 100644 --- a/.changes/objc2-0.3.2.md +++ b/.changes/objc2-0.3.2.md @@ -1,7 +1,7 @@ --- -"tauri": patch -"tauri-runtime": patch -"tauri-runtime-wry": patch +"tauri": patch:deps +"tauri-runtime": patch:deps +"tauri-runtime-wry": patch:deps --- On macOS, updated `objc2-*` dependencies to 0.3.2 From 04125a4ec440ea5f6a76fd996fcb76f05b3b0067 Mon Sep 17 00:00:00 2001 From: Tony Date: Tue, 28 Jul 2026 16:51:15 +0800 Subject: [PATCH 3/3] remove unsafe on ios --- crates/tauri/src/app.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/tauri/src/app.rs b/crates/tauri/src/app.rs index 95dcbadb83c8..a8da6ee141a8 100644 --- a/crates/tauri/src/app.rs +++ b/crates/tauri/src/app.rs @@ -679,7 +679,7 @@ impl AppHandle { #[cfg(target_os = "ios")] pub fn supports_multiple_windows(&self) -> bool { let (tx, rx) = std::sync::mpsc::channel(); - let _ = self.run_on_main_thread(move || unsafe { + let _ = self.run_on_main_thread(move || { let mtm = objc2::MainThreadMarker::new().unwrap(); let ui_application = objc2_ui_kit::UIApplication::sharedApplication(mtm); tx.send(ui_application.supportsMultipleScenes()).unwrap(); @@ -1263,11 +1263,9 @@ impl App { /// Whether the application supports multiple windows. #[cfg(target_os = "ios")] pub fn supports_multiple_windows(&self) -> bool { - unsafe { - let mtm = objc2::MainThreadMarker::new().unwrap(); - let ui_application = objc2_ui_kit::UIApplication::sharedApplication(mtm); - ui_application.supportsMultipleScenes() - } + let mtm = objc2::MainThreadMarker::new().unwrap(); + let ui_application = objc2_ui_kit::UIApplication::sharedApplication(mtm); + ui_application.supportsMultipleScenes() } /// Sets the activation policy for the application. It is set to `NSApplicationActivationPolicyRegular` by default.