question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DWM titlebar is rendered behind WinUI3 titlebar

See original GitHub issue

Describe the bug

When using a custom titlebar in a WinUI3 desktop program (C# or C++), the DWM native titlebar is still being rendered behind WinUI3’s content. (DwmExtendFrameIntoClientArea is still being called).

47

Steps to reproduce the bug

Steps to reproduce the behavior:

  1. Create a new desktop project
  2. Add either just a call to ExtendsContentIntoTitleBar(true); in the constructor of the main window or add that and a this->SetTitleBar(TitleBar()); call.
  3. Build, run, and resize the window to see

Expected behavior The native window frame should not be extended at all, or WinUI should use only the native window frame instead of drawing its own. Personally, I prefer to use the DWM frame, as WinUI controls can overlap everything except the caption buttons. If the caption buttons should have their colors changed, it seems like upcoming Windows 11 DWM apis can achieve that goal: https://github.com/microsoft/WindowsAppSDK/issues/41#issuecomment-892637002

On the other hand, the jittering when resize needs to really be fixed; platform api’s and UWP Core/AppWindows don’t have the same problem.

Version Info

NuGet package version: [WinUI 3 - Windows App SDK 0.8: 0.8.2]

Windows app type:

Win32
YES
Windows version Saw the problem?
Insider Build (22000.160) YES
Device form factor Saw the problem?
Desktop YES

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
pratikonecommented, Feb 4, 2022

closing it. feel free to re-open it something changes

1reaction
pratikonecommented, Feb 4, 2022

@AzAgarampur yes actually. thanks for the patience. I have found the issue and the fix and it will be released in a future release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Title bar customization - Windows apps
This article shows how to customize the title bar for apps that use either the Windows App SDK, WinUI 3, or UWP with...
Read more >
Re-drawing the Window title when using custom chrome ...
I have located a guide at Custom Window Frame using DWM (Windows) that details the painting the caption title. I am not really...
Read more >
Deleted the post about introducing a dark title bar without ...
To enable the dark title bar, call a Desktop Windows Manager (DWM) function called DwmSetWindowAttribute on your top-level window, using the ...
Read more >
WinUI – The modern native UI platform of Windows
It makes sense for simple apps that are mainly rendering and outputting ... Double Click on the titlebar works in most applications.
Read more >
Announcing Windows 11 Insider Preview builds [Mega- ...
Fixes an issue where certain parts of the title bar couldn't be used to drag the window. [Windows Spotlight]​. The following fixes only...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found