Skip to content

Win32: Clear to black in WM_PAINT for transparent framebuffer windows#2815

Open
jeweg wants to merge 1 commit into
glfw:masterfrom
jeweg:fix-win32-transparent-framebuffer
Open

Win32: Clear to black in WM_PAINT for transparent framebuffer windows#2815
jeweg wants to merge 1 commit into
glfw:masterfrom
jeweg:fix-win32-transparent-framebuffer

Conversation

@jeweg

@jeweg jeweg commented Jan 21, 2026

Copy link
Copy Markdown

The DWM redirection surface may contain undefined alpha values, causing the window to composite incorrectly. PatBlt with BLACKNESS clears both RGB and alpha to zero.
Repro for the issue: https://github.com/jeweg/glfw_repro1

The DWM redirection surface may contain undefined alpha values,
causing the window to composite incorrectly. PatBlt with BLACKNESS
clears both RGB and alpha to zero.
@jeweg jeweg requested a review from elmindreda as a code owner January 21, 2026 18:57
@dougbinks dougbinks added bug Bug reports and bugfix pull requests Windows Win32 specific (not Cygwin or WSL) labels Mar 1, 2026
@jeweg

jeweg commented Apr 15, 2026

Copy link
Copy Markdown
Author

For more background, I also explore the approaches for window transparency on Windows in this repository. This particular fix for GLFW uses what I show in 06_perpixel_alpha_patblt.cpp over there.

@maxime-modulopi

maxime-modulopi commented Apr 20, 2026

Copy link
Copy Markdown

I can confirm this PR fixes the transparency issue I was having on NVIDIA RTX A4000 in DXGI swapchain mode.

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

Labels

bug Bug reports and bugfix pull requests Windows Win32 specific (not Cygwin or WSL)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants