Fix SplashScreen fade-out transparency regression after CsWin32 refactor (#11321)#11485
Fix SplashScreen fade-out transparency regression after CsWin32 refactor (#11321)#11485sachPundir wants to merge 1 commit intodotnet:mainfrom
Conversation
|
@dipeshmsft @harshit7962 This PR addresses the SplashScreen transparency regression introduced during the CsWin32 refactor. I reproduced the issue using a PNG with transparent regions and verified that the fix resolves the gray artifact during fade-out. Could you please review it when you have time? Let me know if any changes or additional tests are needed. |
Initialize _blendFunction instead of using a local BLENDFUNCTION instance. During fade-out, the uninitialized field caused AlphaFormat to be 0, resulting in transparent regions rendering gray. Fixes dotnet#11321
0c35e4c to
77f7770
Compare
|
I’ve rebased this PR on the latest main and re-verified the fix. This resolves the SplashScreen transparency regression (gray artifact during fade-out with transparent PNGs). Could you please take a look when convenient? |
|
Hi @harshit7962 @lindexi, Following up on this — the PR has approvals from @miloush and @manishasoam-hub and all checks are passing. Since @dipeshmsft seems unavailable, could one of you please take a look for final approval? This fixes a SplashScreen transparency regression introduced during the CsWin32 refactor. Thanks! |
|
@sachPundir Sorry, I have not the permission to merge. |
|
@lindexi Thanks for responding — really appreciate you taking a look! |
|
@sachPundir The official WPF repo hasn't been active for a while, so I'm planning to put out some third-party builds. |
|
@lindexi Thanks for sharing this — that’s really helpful context. |
Fixes #11321
Description
During the migration of
SplashScreento CsWin32 APIs,CreateWindowinitialized a local
BLENDFUNCTIONvariable and passed it toUpdateLayeredWindow, but never assigned it to the_blendFunctionfield.As a result,
_blendFunctionused inFadeout_Tickremaineddefault-initialized with
AlphaFormat = 0. WithoutAC_SRC_ALPHA,UpdateLayeredWindowignores per-pixel alpha entirely, causing transparentregions of the splash image to briefly render as black during fade-out.
The fix assigns directly to
_blendFunctioninCreateWindowso thatFadeout_Tickinherits the correctAlphaFormat = AC_SRC_ALPHA.Customer Impact
Applications using
SplashScreenwith PNG images containing transparencywill see transparent regions turn black during fade-out.
Regression
Yes. Introduced during the CsWin32 refactor of
SplashScreen.Testing
remain transparent throughout.
autoCloseand manualClose(TimeSpan)scenarios.Risk
Low. Single-field initialization change. No logic, API, or behavioral
changes beyond correcting the regression.
Microsoft Reviewers: Open in CodeFlow