Skip to content

fix(window): transparent windows on Windows set WS_EX_NOREDIRECTIONBITMAP - #1458

Merged
Hona merged 1 commit into
devfrom
fix/415-win-no-redirection-bitmap
Nov 23, 2026
Merged

Hona merged 1 commit into
devfrom
fix/415-win-no-redirection-bitmap

Conversation

@Hona

@Hona Hona commented Nov 23, 2026

Copy link
Copy Markdown
Member

Fixes #415

Root cause

  • WindowOptions::attributes (crates/rune/src/window/spec.rs) called .with_transparent(self.transparent) without setting WindowAttributesExtWindows::with_no_redirection_bitmap(true) on Windows.
  • Without WS_EX_NOREDIRECTIONBITMAP, Win32 kept an opaque GDI redirection bitmap behind the DirectComposition swapchain (Dx12SwapchainKind::DxgiFromVisual), causing both transparent: true windows and WindowOptions::overlay(display) windows to render opaque instead of compositing over the desktop (whereas overlays in crates/rune/src/overlay/lifetime.rs already set with_no_redirection_bitmap(true)).

Changes

  • crates/rune/src/window/spec.rs: in WindowOptions::attributes, under #[cfg(target_os = "windows")], call attrs.with_no_redirection_bitmap(true) when self.transparent is true. Opaque windows keep the redirection bitmap for GDI CPU-first startup (opens_on_cpu in crates/rune/src/window/win32/cpu_frame.rs already excludes transparent windows).
  • crates/rune/src/window/spec_tests.rs: added windows_transparent_attributes_disable_redirection_bitmap verifying no_redirection_bitmap is false for opaque windows and true for transparent: true, WindowOptions::overlay, and WindowOptions::launcher_panel.
  • changelog/unreleased/2026-11-23-windows-transparent-redirection-bitmap.md: added unreleased changelog fragment.

Verification

  • Verified windows_transparent_attributes_disable_redirection_bitmap failed before the fix and passed after (cargo test -p rune -p rune-mermaid -p rune-kit --features rune-kit/markdown,rune-kit/mermaid windows_transparent_attributes_disable_redirection_bitmap).
  • Ran cargo test -p rune -p rune-mermaid -p rune-kit --features rune-kit/markdown,rune-kit/mermaid window::spec (12 passed) and scripts/file-size.sh (0 errors).
  • Not verified on this machine: interactive desktop visual rendering of a live transparent window / examples/overlay over DWM (cannot open GUI windows during automated runs).

@Hona
Hona merged commit 0e82b82 into dev Nov 23, 2026
1 check passed
@Hona
Hona deleted the fix/415-win-no-redirection-bitmap branch November 23, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: a transparent window is opaque (no WS_EX_NOREDIRECTIONBITMAP)

1 participant