Fix SplashScreen fade-out transparency regression after CsWin32 refactor (#11321)#11485
Open
sachPundir wants to merge 1 commit intodotnet:mainfrom
Open
Fix SplashScreen fade-out transparency regression after CsWin32 refactor (#11321)#11485sachPundir wants to merge 1 commit intodotnet:mainfrom
sachPundir wants to merge 1 commit intodotnet:mainfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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