From d4ed27909a002a686397f087100b0b316de803d0 Mon Sep 17 00:00:00 2001 From: Tony Date: Thu, 27 Feb 2025 15:18:40 +0800 Subject: [PATCH] fix(deps): os webview not gated in wry feature --- .changes/os-webview-wry-feature.md | 5 +++++ crates/tauri/Cargo.toml | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 .changes/os-webview-wry-feature.md diff --git a/.changes/os-webview-wry-feature.md b/.changes/os-webview-wry-feature.md new file mode 100644 index 000000000000..d8519df19b86 --- /dev/null +++ b/.changes/os-webview-wry-feature.md @@ -0,0 +1,5 @@ +--- +tauri: 'patch:bug' +--- + +Fix OS webviews (`webview2` and `webkit2gtk`) are always compiled with tauri even without `wry` feature diff --git a/crates/tauri/Cargo.toml b/crates/tauri/Cargo.toml index c21b20237a6d..47e7ea891533 100644 --- a/crates/tauri/Cargo.toml +++ b/crates/tauri/Cargo.toml @@ -95,7 +95,7 @@ tray-icon = { version = "0.20", default-features = false, features = [ # linux [target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies] gtk = { version = "0.18", features = ["v3_24"] } -webkit2gtk = { version = "=2.0.1", features = ["v2_40"] } +webkit2gtk = { version = "=2.0.1", features = ["v2_40"], optional = true } # macOS [target.'cfg(target_os = "macos")'.dependencies] @@ -120,9 +120,13 @@ window-vibrancy = "0.6" # windows [target."cfg(windows)".dependencies] -webview2-com = "0.36" +webview2-com = { version = "0.36", optional = true } window-vibrancy = "0.6" -windows = { version = "0.60", features = ["Win32_Foundation"] } +windows = { version = "0.60", features = [ + "Win32_Foundation", + "Win32_UI", + "Win32_UI_WindowsAndMessaging", +] } # mobile [target.'cfg(any(target_os = "android", all(target_vendor = "apple", not(target_os = "macos"))))'.dependencies] @@ -180,7 +184,7 @@ tray-icon = ["dep:tray-icon"] tracing = ["dep:tracing", "tauri-macros/tracing", "tauri-runtime-wry/tracing"] test = [] compression = ["tauri-macros/compression", "tauri-utils/compression"] -wry = ["tauri-runtime-wry"] +wry = ["webview2-com", "webkit2gtk", "tauri-runtime-wry"] # TODO: Remove in v3 - wry does not have this feature anymore objc-exception = [] linux-libxdo = ["tray-icon/libxdo", "muda/libxdo"]