WPF WindowChrome Rendering Issue
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
* .NET Core Version: .Net Core 3.1 (also emulating x86 on ARM machines)
* Windows version: 19041.1.arm64fre.vb_release.191206-1406 (also repros on non ARM build versions of 20H2)
* Does the bug reproduce also in WPF for .NET Framework 4.8?: Not sure as the repro is super inconsistent.
* 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](https://docs.microsoft.com/visualstudio/ide/how-to-report-a-problem-with-visual-studio?view=vs-2019).
* Security issues and bugs should be reported privately, learn more via our [responsible disclosure guidelines](https://github.com/dotnet/wpf/blob/master/README.md#reporting-security-issues-and-security-bugs).
**Problem description:**
***WPF WindowChrome Rendering Issue***
Content: We are implementing a custom titlebar using Window Chrome. The titlebar has UI controls and some XAML elements (back button, text box, toggle button, caption buttons). There is an issue where sometimes the WindowChrome titlebar does not correctly render.
**Actual behavior:**
***Video available at:*** https://1drv.ms/v/s!AtCv9_WVsvyQhRPZEgllXx_tcVnM?e=xroU1r
Notice that the titlebar looks blank on the small spawned window. Then as the user hovers over the titlebar, the elements become visible as the user hovers over them.
**Expected behavior:**
See attached screenshot. Notice that the titlebar content renders fine.
**Minimal repro:**
It seems to be a weird race condition in the rendering by the OS. There is no definite repro. It sometimes repros when going through the 2 scenarios below.
1. Go to Window Start -> Launch Your Phone. Go to Apps Node in Your Phone. Open any app (please message me at dabang@microsoft.com before testing so I can get you the right configurations to test).
2. Another possible test is https://engy.us/blog/2020/01/01/implementing-a-custom-window-title-bar-in-wpf/ copy and base the window chrome titlebar implementation from here. Copy and paste this into a basic WPF window styling (message me at dabang@microsoft.com if you need help setting up). Test the rendering and see if titlebar elements render correctly.
Contributor guide
Assessment
This issue has not been assessed yet.