wpf icon indicating copy to clipboard operation
wpf copied to clipboard

Application icon appears blank/generic if the loaded event is processing background task

Open hermanusb opened this issue 1 month ago • 7 comments

Setup for WPF App:

Image

Set Project settings icon location:

Image

After running the wpf app, the icon on the taskbar is blank.

Image

Note this does not occur on Windows 10

Image

Here is a link to an article describing a similar issue after the latest update: https://learn.microsoft.com/en-us/answers/questions/2201775/windows-forms-application-icon-suddenly-shows-as-d

We're trying to fix an issue where the icon randomly disappears though the behaviour is difficult to replicate seeing as this only happens ever so often.

hermanusb avatar Nov 03 '25 09:11 hermanusb

That is not a background task, you are putting main UI thread to sleep, effectively causing the app to hang.

miloush avatar Nov 03 '25 10:11 miloush

@miloush Apologies, I should have added more detail e.g. the fact that it does not exhibit this behaviour on Windows 10.

hermanusb avatar Nov 03 '25 13:11 hermanusb

fix async MainWindow_Loaded(object sender, RoutedEventArgs s) { await Task.Delay(1000); }

mehdininja avatar Nov 04 '25 02:11 mehdininja

Thank you for creating this issue, we are experiencing the same issue sporadically for several months now, but we weren't able to find the root cause. Having this information helps us to mitigate the problem. Still I would agree that this is a regression in the taskbar process.

MichaeIDietrich avatar Nov 05 '25 20:11 MichaeIDietrich

We are also experiencing the same issue.

Doing work on the UI thread breaks the icon in certain events. ie loaded.

I've managed to replicate on the loaded event of any control within the main window as well.

I could also replicate doing work on the activated event of the window.

I didn't dig too much on what else breaks, but doing work on the UI thread for as low as 500ms breaks things.

We have a very large Silverlight project ported to WPF and have bad events all over the shop.

I'm trying to track down which event on which control is causing our issues. Since its pretty random for us at least it's tough to find the culprit

While we are replicating on the loaded event, it doesn't mean it's not being caused by a large chunky style. (i'll try give this idea a bash)

If there any contacts within the Microsoft windows team to escalate this with them.

We can "fix" it by setting the icon again.

We can't replicate the same issue on windows 10.

Krudonix avatar Nov 06 '25 08:11 Krudonix

If the reason is that the application is unresponsive, I guess OS can decide how it wants to indicate this to user (such as washed out UI). Or is the issue that once you become responsive again, the icon does not restore?

Does this happen for non-WPF apps? Because I am not sure what could WPF do here. You can report Windows issues using Windows Feedback.

miloush avatar Nov 06 '25 09:11 miloush

Does this happen for non-WPF apps?

@miloush Yes, I can find this issues in the NSIS installer application.

lindexi avatar Nov 06 '25 09:11 lindexi