Skip to content

Windows: a transparent window is opaque (no WS_EX_NOREDIRECTIONBITMAP) #415

Closed

Description

@jzinno

What happens

On Windows, a transparent: true window is opaque: nothing behind it shows through.

use rune::{App, AppSpec, Color, Cx, El, WindowOptions, col};

fn view(_: &(), _: &mut Cx<()>) -> El {
    col().w_full().h_full().fill(Color::BLACK.alpha(0.5))
}

fn main() {
    App::new(AppSpec::new("repro", (400.0, 300.0), || (), view))
        .window_options(WindowOptions { transparent: true, ..Default::default() })
        .run();
}

Expected: the desktop through the window, darkened by half. Actual: flat gray.

Why

WindowOptions::attributes (crates/rune/src/windows.rs) never calls with_no_redirection_bitmap(true), so the window keeps an opaque redirection bitmap under its DirectComposition swapchain. Overlays already set it (overlay.rs:778), which is why they work.

Proposed fix

#[cfg(target_os = "windows")]
if self.transparent {
    use winit::platform::windows::WindowAttributesExtWindows;
    attrs = attrs.with_no_redirection_bitmap(true);
}

Tested at 1ea05bc on Windows 11 (DX12, NVIDIA): the repro shows the desktop through the window with the fix and flat gray without it.

Activity

  1. fahreziadh commented on Nov 13, 2026

    @fahreziadh

    The same cause also hits WindowOptions::overlay(display) windows. They go through WindowOptions::attributes too, so a full-display overlay draws as an opaque white sheet over the whole display.

    Repro: run examples/overlay at a4e5bea. A DXGI Desktop Duplication capture shows the whole display white, with only the green stroke on top. The result is the same with WGPU_ADAPTER_NAME set to the integrated adapter (AMD Radeon) or the discrete one (NVIDIA RTX 5070 Ti Laptop), and with RUNE_WHOLE_FRAMES=1.

    Setup: Windows 11 (build 26200), a hybrid laptop with an AMD iGPU and an NVIDIA dGPU, one 2560×1600 display at 150%. Earlier, on the same machine with two external displays attached, the same example was transparent.

    Fix: the change proposed above (with_no_redirection_bitmap(true) when transparent) fixes it here. After the change, the example and an app with one overlay per display both show the desktop through the overlay.

  2. Hona commented on Nov 23, 2026

    @Hona
    Member

    WindowOptions::attributes did not set WS_EX_NOREDIRECTIONBITMAP (with_no_redirection_bitmap(true)) for transparent windows on Windows, leaving an opaque GDI redirection bitmap behind the DirectComposition swapchain. Fixed on dev in #1458 (

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions