[bug] macOS .transparent(true) Webview Windows Lose Transparency After DMG Build
Describe the bug
I'm facing an issue on Macos where Webview windows in my Tauri v2 app lose transparency after bundling.
In development, when I run tauri dev, my windows created with .transparent(true) render exactly as expected, fully transparent with no background. But when I build the app using tauri build --bundles dmg and run the .app from the DMG, those same windows show up as solid white instead of transparent.
I’ve confirmed that "macOSPrivateApi": true is set correctly in my tauri.conf.json, and I’ve tried building with TAURI_PRIVATE_API=1 and the tauri/macos-private-api feature.
I've also tried setting the activation policy to Accessory as outlined in issue #8255, but this also did not work #[cfg(target_os = "macos")] app.set_activation_policy(tauri::ActivationPolicy::Accessory);
The html files for my WebviewUrl also have 'transparent' applied in the
This seems like a bug where the transparency configuration is being ignored or stripped during the packaging process, even though it works fine in dev.
Reproduction
No response
Expected behavior
No response
Full tauri info output
[✔] Environment
- OS: Mac OS 15.4.1 arm64 (X64)
✔ Xcode Command Line Tools: installed
✔ rustc: 1.86.0 (05f9846f8 2025-03-31)
✔ cargo: 1.86.0 (adf9b6ad1 2025-02-28)
✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
✔ Rust toolchain: stable-aarch64-apple-darwin (default)
- node: 23.11.0
- pnpm: 8.6.9
- npm: 10.9.2
- bun: 1.1.42
[-] Packages
- tauri 🦀: 2.5.1
- tauri-build 🦀: 2.2.0
- wry 🦀: 0.51.2
- tao 🦀: 0.33.0
- @tauri-apps/api : 2.5.0
- @tauri-apps/cli : 2.5.0
[-] Plugins
- tauri-plugin-clipboard-manager 🦀: 2.2.2
- @tauri-apps/plugin-clipboard-manager : 2.2.2
- tauri-plugin-fs 🦀: 2.2.1
- @tauri-apps/plugin-fs : 2.2.1
- tauri-plugin-sql 🦀: git+https://github.com/tauri-apps/plugins-workspace?branch=v2#682bb47cda23d70d56cc7e2afd36ee448ab9c756 (2.2.0)
- @tauri-apps/plugin-sql : 2.2.0
- tauri-plugin-os 🦀: 2.2.1
- @tauri-apps/plugin-os : 2.2.1
- tauri-plugin-opener 🦀: 2.2.6
- @tauri-apps/plugin-opener : 2.2.6
[-] App
- build-type: bundle
- CSP: unset
- frontendDist: ../dist
- devUrl: http://localhost:1420/
- framework: React
- bundler: Vite
Stack trace
Additional context
The top image is the result of 'bun run tauri dev', the bottom image is the result of building and running the dmg after 'bun tauri build --bundles dmg'
This is the first time I hear about something like this.
Would you happen to be able to provide a minimal reproduction? Or alternatively, is your current project public?
Speaking of reproduction, did you already try to confirm this behavior in a fresh create-tauri-app project?
Speaking of reproduction, did you already try to confirm this behavior in a fresh create-tauri-app project?
I created a fresh create-tauri-app project with a simple command to spawn a transparent window (https://github.com/Josssiiiah/test).
I can confirm the window appears transparent in local development. In the bundled dmg, the same window appears opaque with no rounded border.
Thanks for looking into it!
same happens to me. any updates?