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

WPF WindowChrome Rendering Issue #3675

Open
davidbangMicrosoft opened this issue Oct 21, 2020 · 2 comments
Open

WPF WindowChrome Rendering Issue #3675

davidbangMicrosoft opened this issue Oct 21, 2020 · 2 comments
Milestone

Comments

@davidbangMicrosoft
Copy link

  • .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.
  • Security issues and bugs should be reported privately, learn more via our responsible disclosure guidelines.

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.
ExpectedResult

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.

@ClosetBugSlayer
Copy link

ClosetBugSlayer commented Oct 26, 2020

#3193 I think these are related, I don't think WindowChrome is making the right assumptions about how and when system title bars are drawn, or how to correctly disable them.

@davidbangMicrosoft
Copy link
Author

Judging by how, moving or resizing the window seems to fix the rendering, I think you're correct in saying it is a similar bug to #3193 . @ClosetBugSlayer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants