Skip to content

[bug] On macOS, when setting the window radius, the WebView does not display the expected radius. #14165

Description

@SpuerMomonga

Describe the bug

Use the following code to create a window, set a rounded corner for the window, and the window will display the expected rounded corner.

    let effects = tauri::window::EffectsBuilder::new()
        .effects(vec![tauri::window::Effect::WindowBackground])
        .radius(12.0)
        .build();

    let window = tauri::WindowBuilder::new(handle, "main")
        .resizable(true)
        .title("Raykit")
        .min_inner_size(400.0, 400.0)
        .inner_size(750.0, 475.0)
        .center()
        .visible(false)
        .transparent(true)
        .decorations(false)
        .effects(effects)
        .build()?;
Image

In the code below, after adding a webview of the same size to the window, the webview does not display the expected rounded corner effect.

let effects = tauri::window::EffectsBuilder::new()
        .effects(vec![tauri::window::Effect::WindowBackground])
        .radius(12.0)
        .build();

    let window = tauri::WindowBuilder::new(handle, "main")
        .resizable(true)
        .title("Raykit")
        .min_inner_size(400.0, 400.0)
        .inner_size(750.0, 475.0)
        .center()
        .visible(false)
        .transparent(true)
        .decorations(false)
        .effects(effects)
        .build()?;

    window.add_child(
        tauri::WebviewBuilder::new("main-app", tauri::WebviewUrl::App(Default::default())).auto_resize(),
        tauri::LogicalPosition::new(0., 0.),
        tauri::LogicalSize::new(750., 475.),
    )?;
Image

Reproduction

https://github.com/raykit-apps/raykit

Expected behavior

When the window is set with rounded corners, the WebView will also be covered by the rounded corners.

Full tauri info output

[✘] Environment
    - OS: Mac OS 15.6.1 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✘ Xcode: not installed!
    ✔ rustc: 1.87.0 (17067e9ac 2025-05-09)
    ✔ cargo: 1.87.0 (99624be96 2025-05-06)
    ✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 22.18.0
    - pnpm: 10.11.1
    - npm: 10.9.3
    - bun: 1.2.21

[-] Packages
    - tauri 🦀: 2.8.5
    - tauri-build 🦀: 2.4.1
    - wry 🦀: 0.53.3
    - tao 🦀: 0.34.3
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli : 2.8.4

[-] Plugins

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../../out
    - devUrl: http://localhost:3000/
    - framework: React

Stack trace


Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions