From 1e031bc5ce597a74ec16e0cb1e609d173bec91f7 Mon Sep 17 00:00:00 2001 From: clover caruso Date: Thu, 1 Oct 2026 17:28:25 -0700 Subject: [PATCH] fix: Dark chrome over dark Mica on Windows 11 from the first frame The window shows before its first frame, and the desktop fills the unpainted GDI surface white. Under Direct3D 12 frames go through DirectComposition over that surface, so the transparent toolbar showed white rather than Mica until a resize reallocated it. The glass frame now erases it to black, which the extended frame shows as the material. Assisted-by: claude-opus-5.5 --- crates/snowbound/src/windows.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/snowbound/src/windows.rs b/crates/snowbound/src/windows.rs index 9c0965e64a2476cd268070d42640568fdbafa7c2..be8b64d254e8ff49d76aadf877c8b6c94492ba77 100644 --- a/crates/snowbound/src/windows.rs +++ b/crates/snowbound/src/windows.rs @@ -434,6 +434,20 @@ fn glass_frame( extend_frame(hwnd); None } + // Transparent frames show the window's GDI surface, which the desktop fills white + // until painted; black is clear over the extended frame. + wm::WM_ERASEBKGND => { + let mut client = RECT::default(); + unsafe { + wm::GetClientRect(hwnd, &mut client); + Gdi::FillRect( + wparam as Gdi::HDC, + &client, + Gdi::GetStockObject(Gdi::BLACK_BRUSH), + ); + } + Some(1) + } _ => None, } } -- 2.54.0