Skip to content

[Bug] Windows 10: transparent always-on-top window sporadically renders transparent areas / desktop wallpaper black (composition race when toggling cursor events or minimizing) #15947

Description

@wersling

Describe the bug

We ship a desktop-pet style game (transparent always-on-top window is its core form factor): a large (1440×900) transparent: true, alwaysOnTop: true, decorations: false, shadow: false window rendering a WebGL (PixiJS) scene on a transparent canvas (backgroundAlpha: 0), with HTML div UI on top. Because it is a desktop pet, we frequently toggle set_ignore_cursor_events() as the cursor moves in/out of the interactive region (a "cursor event guard": transparent areas of the window are click-through, the canvas area is interactive).

Players on Windows 10 report two sporadic rendering failures, both observed in player-recorded videos:

  1. Desktop wallpaper turns black while the app is minimized, and restores when the window is brought back. The wallpaper file itself is never modified — purely a display failure that self-recovers with the window state change.
  2. The window's transparent areas turn black during normal interaction (e.g. opening a UI panel, entering item-placement mode, moving the cursor across the canvas boundary) — exactly the moments our app toggles set_ignore_cursor_events().

Both are low-probability events under high-frequency triggers: the vast majority of toggles/minimizes render correctly.

Expected behavior

Transparent regions and the desktop wallpaper should stay correctly composed on Windows 10 when toggling set_ignore_cursor_events or minimizing/restoring a transparent always-on-top window.

Analysis (from reading tao 0.34.8 sources)

  • tao/src/platform_impl/windows/window.rs — when attributes.transparent && !pl_attribs.no_redirection_bitmap, tao enables the legacy DwmEnableBlurBehindWindow + empty-region (0, 0, -1, -1) hack for full-window transparency.
  • tao/src/platform_impl/windows/window_state.rsset_ignore_cursor_events toggles WS_EX_TRANSPARENT | WS_EX_LAYERED via SetWindowLongPtr, forcing DWM to rebuild the composition tree (layered ⇄ direct composition path).

Our working model: BlurBehind hack + frequent WS_EX_LAYERED toggles (cursor guard) + minimize/restore of a large always-on-top transparent window occasionally race with DWM's composition-tree rebuild on Windows 10, losing either the window's alpha or the wallpaper layer (WorkerW) for a moment — the "black" being an invalid/uninitialized surface. We are still correlating occurrences with dwm.exe events in the Windows Event Log to determine whether DWM actually restarts or this is a non-crash composition failure, so the model above is our best current hypothesis rather than a confirmed root cause.

Relation to #15410

noRedirectionBitmap (WS_EX_NOREDIRECTIONBITMAP / DirectComposition path) looks like the structural fix for this class of issue: it sidesteps the BlurBehind hack entirely. Questions for maintainers:

  1. Which release will include feat(core): add no_redirection_bitmap API on Windows #15410 — a 2.12.0? Any chance of a backport to 2.11.x?
  2. Are you aware of other Windows 10 reports where toggling set_ignore_cursor_events or minimizing transparent windows corrupts composition (black wallpaper / black transparent areas)? Possibly related: [bug] window effects leak out of the window on Windows 10 #12849, [bug] maximized window config causes black flash on launch #11284.

Platform and Versions

  • tauri: 2.10.3 (tao 0.34.8, wry 0.48.0)
  • OS: Windows 10 (player reports so far; exact builds + GPU/driver info being collected)
  • WebView2 runtime: affected machines' versions being collected
  • Frontend: PixiJS 8 WebGL canvas (backgroundAlpha: 0, preference: 'webgl'), HTML div UI coexisting in the same transparent window

Additional context

  • App: "PicoCat", a Steam desktop-pet / idle game.
  • We plan mitigations on our side (hide-to-tray instead of minimize; debouncing cursor-event toggles), but the underlying composition path seems worth flagging upstream.
  • Happy to provide player videos / Windows Event Log data once collected.

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