Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Additional window rendering #12849

Open
Burial0268 opened this issue Feb 28, 2025 · 2 comments
Open

[bug] Additional window rendering #12849

Burial0268 opened this issue Feb 28, 2025 · 2 comments
Assignees
Labels
platform: Windows status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@Burial0268
Copy link

Describe the bug

An unexpected window overlay is rendered outside the window border, and the WindowEffect is set as expected

Screenshots:

Image

Image

Reproduction

I have the following code in main.rs:

async fn create_main_window(app_handle: &AppHandle) -> Result<WebviewWindow, tauri::Error> {
    let window = tauri::WebviewWindowBuilder::new(
        app_handle,
        "main",
        tauri::WebviewUrl::App("index.html".into()),
    )
    .title("Tauri Application")
    .inner_size(984.0, 703.0)
    .min_inner_size(700.0, 550.0)
    .decorations(true)
    .resizable(true)
    .maximizable(true)
    .visible(false)
    .additional_browser_args("--enable-features=msWebView2EnableDraggableRegions --disable-features=OverscrollHistoryNavigation,msExperimentalScrolling")
    .transparent(true)
    .effects(WindowEffectsConfig {
        effects: vec![],
        state: None,
        radius: None,
        color: None
    })
    .build()?;

    window.restore_state(StateFlags::all())?;
    setup_window_events(window.clone());

    Ok(window)
}

The function setup_window_events is about listening the window_state and printing them out while debugging, so it would not effect the window's config.

The main.rs has another part below that might effect this, but i'm not sure currently:

pub fn setup_window_decoration(window: &WebviewWindow) -> Result<(), Box<dyn std::error::Error>> {
    window.create_overlay_titlebar()?;

    #[cfg(target_os = "macos")] {
        window.set_traffic_lights_inset(12.0, 16.0)?;
        window.make_transparent()?;
        window.set_window_level(25)?;
    }

    Ok(())
}

Additionally, the window.create_overlay_titlebar()?; is brought by crate tauri-plugin-decorum.

Expected behavior

No extra border

Full tauri info output

> tauri "info"


[✔] Environment
    - OS: Windows 10.0.19045 x86_64 (X64)
    ✔ WebView2: 133.0.3065.82
    ✔ MSVC:
        - Visual Studio Community 2022
        - Visual Studio 生成工具 2019
    ✔ rustc: 1.85.0 (4d91de4e4 2025-02-17)
    ✔ cargo: 1.85.0 (d73d2caf9 2024-12-31)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)       
    - node: 20.15.1
    - pnpm: 9.15.0
    - yarn: 1.22.19
    - npm: 9.6.6

[-] Packages
    - tauri 🦀: 2.3.0
    - tauri-build 🦀: 2.0.6
    - wry 🦀: 0.50.1
    - tao 🦀: 0.32.5
    - @tauri-apps/api : 2.1.1 (outdated, latest: 2.3.0)
    - @tauri-apps/cli : 2.1.0 (outdated, latest: 2.3.0)

[-] Plugins
    - tauri-plugin-shell 🦀: 2.2.0
    - @tauri-apps/plugin-shell : 2.0.1 (outdated, latest: 2.2.0)   
    - tauri-plugin-window-state 🦀: 2.2.1
    - @tauri-apps/plugin-window-state : 2.0.0 (outdated, latest: 2.2.1)
    - tauri-plugin-dialog 🦀: 2.2.0
    - @tauri-apps/plugin-dialog : 2.0.1 (outdated, latest: 2.2.0)  
    - tauri-plugin-persisted-scope 🦀: 2.2.0
    - @tauri-apps/plugin-persisted-scope : not installed!
    - tauri-plugin-http 🦀: 2.3.0
    - @tauri-apps/plugin-http : 2.0.1 (outdated, latest: 2.3.0)    
    - tauri-plugin-os 🦀: 2.2.0
    - @tauri-apps/plugin-os : 2.0.0 (outdated, latest: 2.2.0)      
    - tauri-plugin-process 🦀: 2.2.0
    - @tauri-apps/plugin-process : 2.0.0 (outdated, latest: 2.2.0) 
    - tauri-plugin-log 🦀: 2.2.3
    - @tauri-apps/plugin-log : 2.0.0 (outdated, latest: 2.2.3)     
    - tauri-plugin-updater 🦀: 2.5.1
    - @tauri-apps/plugin-updater : 2.0.0 (outdated, latest: 2.5.1) 
    - tauri-plugin-store 🦀: 2.2.0
    - @tauri-apps/plugin-store : 2.1.0 (outdated, latest: 2.2.0)   
    - tauri-plugin-fs 🦀: 2.2.0

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: React
    - bundler: Vite

Stack trace


Additional context

I have try to set the decorations attribute to false but it's useless.
The issue was not found in versions prior to Tauri 2.3.0 using the completely same code.
If additional information is required, I will provide it whenever possible.

@Burial0268 Burial0268 added status: needs triage This issue needs to triage, applied to new issues type: bug labels Feb 28, 2025
@Burial0268
Copy link
Author

seems that is about WindowEffect 🤔

When I set the WindowEffect to None, the original WindowEffect will still apply to the outer window, like this:

Image

Image

@Burial0268
Copy link
Author

In my operating system it could be reproduction when the WindowEffect has been set.
@amrbashir Would it possible that struct WindowEffect has some bugs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Windows status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

3 participants