Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apps with a custom background flash a white background for a couple frames on some devices #5853

Open
1ctinus opened this issue Dec 19, 2021 · 11 comments
Labels
needs more information Not enough information has been provided. Please share more detail as requested
Milestone

Comments

@1ctinus
Copy link

1ctinus commented Dec 19, 2021

  • .NET Core Version: (e.g. 3.0 Preview1, or daily build number, use dotnet --info) 6.0.100
  • Windows version: (winver) Windows 11 10.0.22000
  • Does the bug reproduce also in WPF for .NET Framework 4.8?:
  • Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? If yes, please file the issue via the instructions here.
  • Security issues and bugs should be reported privately, learn more via our responsible disclosure guidelines.

Problem description:
Apps with a custom background flash a white background for a couple frames on some devices (previously asked Stack overflow to no avail, pointed to likely a software issue)
Actual behavior:
Window flashes white before fully loading.
Expected behavior:
Window opens with the correct background color instantly
Minimal repro:

dotnet new wpf

edit MainWindow.xaml to have a background attribute

dotnet build

and run the app.

@singhashish-wpf
Copy link
Member

@1ctinus Is this issue reproducible on previous windows versions/ previous version of .Net Core/ Framework also?

@singhashish-wpf singhashish-wpf added needs more information Not enough information has been provided. Please share more detail as requested and removed Untriaged Requires WPF team triage labels Dec 20, 2021
@1ctinus
Copy link
Author

1ctinus commented Dec 21, 2021

I compiled the program using msbuild 4.8 and running it on the latest version of dotnet, on a separate device running windows 10. the issue persisted.

@batzen
Copy link
Contributor

batzen commented Dec 21, 2021

This also started to happen on my machine like a week ago.
It's does not seem to be isolated to WPF as it also happens with Edge.
See (increased gif frame delay to 250 ms to make it really visible):
window_white_flash

@1ctinus
Copy link
Author

1ctinus commented Dec 26, 2021

I am also having this exact same issue with win32 too.

@vishalmsft
Copy link
Contributor

@1ctinus Can you please use Windows feedback channel to take this up. Hopefully, this issue can be closed.

@ZionGates
Copy link

I'm having the same issue, WPF on DOT NET CORE opens the window slower too, about 2 seconds slower.
However WPF on dot.net 4.8 sometimes didn't open at all periodically and just hung, at least they fixed that after 15 years...

batzen added a commit to ControlzEx/ControlzEx that referenced this issue Jan 7, 2023
@torum
Copy link

torum commented Mar 3, 2023

This is a very old known issue of WPF.

In fact, this has been annoyance since 2005!
https://social.msdn.microsoft.com/Forums/en-US/3960d6a6-e873-455c-9ddc-1e2dd32e090b/flickering-background-when-resizing-window?forum=wpf

The white background flash happens at start up and window resize (including maximizing). This is so obvious with a Window with fairly complex XAML layout with custom title bar using WindowChrome.

I can't believe this "bug" is still present in 2023.

@batzen
Copy link
Contributor

batzen commented Mar 3, 2023

@torum As i already wrote above, this is not a pure WPF issue. The underlying problem is caused by Windows itself.
ControlzEx has code to mitigate the white flash and the resize flickering.

@karelz karelz added this to the Future milestone Sep 15, 2023
@JanHadascok
Copy link

I would like to mention this workaround from SO.
Just set Window Opacity to 0 and then in Loaded event set it back to 1. Its dirty workaround but seems to be ok in my case.

@mhrastegari
Copy link

Any updates on this?

@lindexi
Copy link
Member

lindexi commented Aug 12, 2024

@mhrastegari Could you describe your problem? As same as the author's ? And I think it is the Windows's issues not wpf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more information Not enough information has been provided. Please share more detail as requested
Projects
None yet
Development

No branches or pull requests

10 participants