Skip to content

WPF WindowChrome Rendering Issue #3675

Open

Description

@davidbangMicrosoft
  • .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 [email protected] 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 [email protected] if you need help setting up). Test the rendering and see if titlebar elements render correctly.

Activity

  1. ClosetBugSlayer commented on Oct 26, 2020

    @ClosetBugSlayer

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

  2. davidbangMicrosoft commented on Oct 26, 2020

    @davidbangMicrosoft
    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

  3. added this to the 7.0.0 milestone on Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions