Closed maxkatz6 closed 2 weeks ago
You can test this PR using the following package version. 11.3.999-cibuild0052862-alpha
. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]
You can test this PR using the following package version. 11.3.999-cibuild0052866-alpha
. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]
You can test this PR using the following package version. 11.3.999-cibuild0053298-alpha
. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]
What does the pull request do?
Properly handles WM_NCHITTEST message with extended client decorations enabled. Previously caption buttons were returning NC_CLIENT result, making them no different from the rest of the app in OS eyes. But if we want to support all Windows features, like Win 11 snap layout, we should let OS know about our caption controls.
How was the solution implemented (if it's not obvious)?
There are two nuances in this PR:
CaptionButton > Button#PART_RestoreButton
hierarchy. Same can be re-done later after https://github.com/AvaloniaUI/Avalonia/issues/14908.~ Added Win32Properties.NonClientHitTestResultProperty instead of hardcoding.Due to these nuances, I kept all changes in WindowImpl.CustomCaptionProc.cs class, which is only used with custom title bar.
Fixed issues
Fixes #11409 Fixes #14908