The WindowChrome class needs to be updated & fixed #3887
Labels
Enhancement Requested
Product code improvement that does NOT require public API changes/additions
.NET Framework
Milestone
10.0.19042
)Problem description:
The
WindowChrome
class that allows us to customize the non-client area of WPF windows has a few bugs. First, the sizes for the window frame are not correct and do not represent the correct default window frame sizes.In addition, this class has not been updated for Windows 10. Ever since Windows 10, the right, left, and bottom non-client frames are transparent except for a 1px border which is what gives windows their "borderless" look. When using
WindowChrome
on Windows 10, this is not taken into consideration.The following XAML code will show the current problems with the
WindowChrome
class.XAML:
<WindowChrome/>
There are some problems as you can see:
In order to fix the side border issues on Windows 10, we need to make the XAML the following:
<WindowChrome NonClientFrameEdges="Bottom,Left,Right"/>
Consider making this the default behavior on Windows 10. However, this fixes only the side border problem, as the titlebar is still too small. Also, even though the side border do look fixed, the amount of non-client border that has been brought back is too little (due to the size of all the extended window frames being too small.) This results in:We need the correct extended frame sizes fixed first, because it not only messes up the look of the extended window frame borders, but it also will cause problems when an app is maximized, because the too small frame hangs over the monitor, which can result in transparent holes in the app's UI.
Next, it seems like
WM_NCMOUSELEAVE
is not being handled properly. There are times when the mouse quickly moves over the extended frame's caption buttons then leaves, but the highlight is not removed from the caption button. This picture shows this phenomenon happening on the close button, but it happens on all buttons:The text was updated successfully, but these errors were encountered: