Skip to content

Fix SplashScreen fade-out transparency regression after CsWin32 refactor (#11321)#11485

Open
sachPundir wants to merge 1 commit intodotnet:mainfrom
sachPundir:fix-11321-splashscreen-blendfunction-init
Open

Fix SplashScreen fade-out transparency regression after CsWin32 refactor (#11321)#11485
sachPundir wants to merge 1 commit intodotnet:mainfrom
sachPundir:fix-11321-splashscreen-blendfunction-init

Conversation

@sachPundir
Copy link
Copy Markdown

@sachPundir sachPundir commented Feb 26, 2026

Fixes #11321

Description

During the migration of SplashScreen to CsWin32 APIs, CreateWindow
initialized a local BLENDFUNCTION variable and passed it to
UpdateLayeredWindow, but never assigned it to the _blendFunction field.

As a result, _blendFunction used in Fadeout_Tick remained
default-initialized with AlphaFormat = 0. Without AC_SRC_ALPHA,
UpdateLayeredWindow ignores per-pixel alpha entirely, causing transparent
regions of the splash image to briefly render as black during fade-out.

The fix assigns directly to _blendFunction in CreateWindow so that
Fadeout_Tick inherits the correct AlphaFormat = AC_SRC_ALPHA.

Customer Impact

Applications using SplashScreen with PNG images containing transparency
will see transparent regions turn black during fade-out.

Regression

Yes. Introduced during the CsWin32 refactor of SplashScreen.

Testing

  • Reproduced using PNG with transparent regions on .NET 10 / VS Insiders.
  • Confirmed correct fade-out behavior after fix — transparent regions
    remain transparent throughout.
  • Tested both autoClose and manual Close(TimeSpan) scenarios.
  • Confirmed no regression for fully opaque images.

Risk

Low. Single-field initialization change. No logic, API, or behavioral
changes beyond correcting the regression.

Microsoft Reviewers: Open in CodeFlow

@sachPundir sachPundir requested a review from a team February 26, 2026 18:06
@dotnet-policy-service dotnet-policy-service bot added PR metadata: Label to tag PRs, to facilitate with triage Community Contribution A label for all community Contributions labels Feb 26, 2026
@sachPundir sachPundir changed the title Fix SplashScreen fade-out transparency regression after CsWin32 refactor Fix SplashScreen fade-out transparency regression after CsWin32 refactor (#11321) Feb 26, 2026
@sachPundir
Copy link
Copy Markdown
Author

@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
@sachPundir sachPundir force-pushed the fix-11321-splashscreen-blendfunction-init branch from 0c35e4c to 77f7770 Compare March 27, 2026 17:19
@sachPundir
Copy link
Copy Markdown
Author

Hi @dipeshmsft @harshit7962,

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?

@sachPundir
Copy link
Copy Markdown
Author

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!

@lindexi
Copy link
Copy Markdown
Member

lindexi commented Apr 21, 2026

@sachPundir Sorry, I have not the permission to merge.

@sachPundir
Copy link
Copy Markdown
Author

@lindexi Thanks for responding — really appreciate you taking a look!

@lindexi
Copy link
Copy Markdown
Member

lindexi commented Apr 21, 2026

@sachPundir The official WPF repo hasn't been active for a while, so I'm planning to put out some third-party builds.
I'll run the releases through my study group — it's a non-commercial, tech-focused hobby group just for learning, no business stuff involved.
But WPF's current release process is pretty messy, so I'm working on streamlining it first to make it easy to auto-publish NuGet packages via CI/CD on GitHub Runners.
I've actually done this before already, I published this package a while back: https://www.nuget.org/packages/dotnetCampus.WPF.Resource
But that was just a one-off and didn't have a proper standardized workflow, I'm gonna fix that part.
Only catch is I don't have much spare time to work on this in my off hours, so progress probably won't be super fast.

@sachPundir
Copy link
Copy Markdown
Author

@lindexi Thanks for sharing this — that’s really helpful context.
Your work on improving the release workflow sounds very valuable. Looking forward to seeing it!

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

Labels

Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SplashScreen areas with transparency turn black when fading out in .NET 10

4 participants