microsoft / microsoft/microsoft-ui-xaml
Fully customized title bar covers window's black border on Windows 10
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
I've created a top-level Win32 window with a XAML island filling its entire client area. When I set `ExtendsContentIntoTitleBar = true` on my `AppWindow` with a custom title bar, the black border drawn by DWM is covered across the top (but not the left or the right). I've tried compensating by manually drawing a border across the top of the `Grid` containing my title bar layout, but it still doesn't look right because the caption buttons overlap that border, instead of being inset inside of it.
Since this is on Windows 10, I cannot use DWM APIs to hide the rest of that border myself.
### Steps to reproduce the bug
1. Create a top-level Win32 window, add a XAML island within it;
2. Use `AppWindow.ExtendsContentIntoTitleBar = true` and set a custom title bar layout;
3. Write a simple app that just displays the window
4. Move the app's window in front of a light-colored background (I just move it in front of an empty notepad window)
5. Notice that there is a black border around three sides of the window, but it's missing across the top of the window where the custom title bar is drawn.
### Expected behavior
I expect that on Windows 10 a fully-customized title bar will not obscure the border across the top of the window.
### Screenshots

### NuGet package version
Windows App SDK 1.6.1: 1.6.240923002
### Packaging type
Unpackaged
### Windows version
Windows 10 version 22H2 (19045, 2022 Update)
### IDE
Visual Studio 2022
### Additional context
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Win32 window with a XAML island, AppWindow.ExtendsContentIntoTitleBar, and a custom title bar on Windows 10 version 22H2. Compare the top border with the left and right borders, including the caption buttons; done means the customized title bar no longer obscures the DWM-drawn top border.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100