-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
[WpfGfx] RenderTargetBitmap can produce blank output in headless sessions
Summary
RenderTargetBitmap may produce blank images when an app runs without attached display devices.
Observed behavior
- Rendered bitmap output is blank in headless or temporarily display-detached environments.
- The issue is intermittent but can persist until display topology is restored.
Repro notes
- Start a WPF app that uses
RenderTargetBitmap.Render. - Run the app in a session where no display devices are currently available (for example, a disconnected remote environment).
- Trigger bitmap rendering and inspect the result.
Impact
- Breaks scenarios that depend on off-screen bitmap generation.
- Affects remote/headless workflows and reconnect scenarios where image output must remain reliable.
Expected behavior
RenderTargetBitmap.Render should render valid bitmap content even when no display is attached for this UI-thread synchronous rendering path.
Actual behavior
Rendering can be skipped when display state is invalid, causing blank bitmap output.
Suspected root cause
The composition pipeline blocks rendering on invalid display state unless a compatibility switch is enabled globally. The synchronous UI-thread bitmap rendering path needs a targeted override.
Proposed fix direction
- Thread a
canRenderWithoutDisplayDevicesflag throughPartition::ComposeandCComposition::ProcessComposition. - Pass
truefor the UI-thread synchronous compose path used byRenderTargetBitmap-style rendering. - Pass
falsein the regular partition-thread rendering path to preserve existing default behavior. - Keep compatibility-switch behavior intact as an additional opt-in path for general rendering.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels