Minimized window won't restore sometimes
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
**Symptom:**
I have written a .NET 5.0 WPF application and occasionally it refuses to restore (e.g. clicking on the taskbar) after minimizing. It doesn't always fail to restore, the problem usually happens after a prolonged period of sleep mode. This application is used as a reminder, so it pops up at the right time is important, any help would be appreciated.
**Info:**
[Here](https://github.com/cshung/Tools/tree/main/Calendar) is the source code of my application, it is hopefully not too long.
[Here](https://github.com/cshung/Tools/blob/6aab05209fed64fdce1e7c4a6072027119ecc4ba/Calendar/Calendar.UserInterface/MainWindow.xaml.cs#L18
) is an interesting piece of code. I configured the windows not to resize, and I have logic [here](https://github.com/cshung/Tools/blob/6aab05209fed64fdce1e7c4a6072027119ecc4ba/Calendar/Calendar.UserInterface/MainWindow.xaml.cs#L41) to control minimizing and restoring based on the timer.
Sometimes, using the system context menu and use the move command will fix it, but even that doesn't always work.
**Debugging done:**
- I tried to attach a debugger and click on the taskbar, nothing happened, no first chance exception, no OutputDebugString, nothing shows up.
- I tried to attach PerfView and click on the taskbar when it refuses to restore, it appears except from the obvious program entry points, none of my code is executed. WPF seems to be doing interesting work like Measure and Arrange as if it is rendering, but it isn't.
Contributor guide
Assessment
This issue has not been assessed yet.