Skip to content

Window transparency doesn't work #4886

@icewind

Description

@icewind

Problem

When I initialize the application with setting the window to be transparent, the background is still white and transparent part only appears on resizing. There was similar issue in winit and they claim that it happening because the application doesn't properly handle the OS request to redraw the window. Also in tauri there was an issue with a workaround (the workaround changes nothing) which is fixed in newer versions. Please see the issue. There is a video with exactly the same behavior

Steps To Reproduce

Steps to reproduce the behavior:

  • Create an empty application
  • Set window to be transparent
    let window_builder = dioxus::desktop::WindowBuilder::new()
        .with_title("Window title")
        .with_transparent(true)
        .with_always_on_top(false);

    dioxus::LaunchBuilder::new()
        .with_cfg(
            dioxus::desktop::Config::default()
                .with_menu(None)
                .with_window(window_builder),
        )
        .launch(App);

Expected behavior

The application window becomes transparent

Screenshots

Please see the linked issues in the description

Environment:

  • Dioxus version: 0.7.0
  • Rust version: 1.91.0
  • OS info: Windows 11
  • App platform: Desktop

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions