Repository navigation
Extend the Close button to the window's right edge - #5590
Merged
Gabriel Dufresne (GabrielDuf) merged 1 commit intoOct 23, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused layout change preserves existing resize behavior and icon positioning, with no blocking issues identified.
No open issues 🎉
What changed in this PR
Fixes #5571 by extending the Close button’s background to the window’s right edge without changing resize-edge hit-testing.
Changes:
- Names the Close button so its layout can be adjusted in code.
- Replaces the caption-strip margin with extra Close-button width and padding, preserving icon placement and the maximized layout.
| File | Description |
|---|---|
| src/UniGetUI.Avalonia/Views/MainWindow.axaml.cs | Applies the frame inset to Close-button width and padding instead of strip margin. |
| src/UniGetUI.Avalonia/Views/MainWindow.axaml | Names the Close button for code-behind access. |
Review effort: Balanced
There was a problem hiding this comment.
🤖 Pull request was approved automatically: the AI review is complete and all its review threads are resolved. 🎉
Integration Details
{
"deliveryId": "6ab7ec10-cf14-11f1-937c-7b466fb274b9",
"headSha": "db791b4e08cf9fb96ccb55fdf30413bc8a4ee8c1",
"reviewer": "copilot-pull-request-reviewer[bot]"
}
Gabriel Dufresne (GabrielDuf)
deleted the
fix/caption-buttons-right-edge
branch
October 23, 2026 19:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5571
When the window isn't maximized, the Close button stopped a few pixels short of the window's right edge: about 8 px at 100% scaling, and more at higher DPI.
Cause
#5477 added a right margin to the caption-button strip, equal to the
WS_THICKFRAMEwidth, so the side resize border would take priority over the buttons. OurWM_NCCALCSIZEhandler makes the client area cover the whole window, so that frame band is visible window area, and the margin showed up as an empty strip next to Close.The margin was never needed for hit-testing. The
WM_NCHITTESThandler already returns the side resize edge before it looks at the caption buttons.Fix
The strip is no longer pushed left. Instead, the Close button is widened by the inset and its padding keeps the X centred over the 46 px you can click. The red hover fill now reaches the edge, as it does in native Windows 11 apps, and the outer band still resizes. When maximized the inset is 0, so Close stays at 46 px.
Trade-off
Native apps keep their resize band in an invisible margin outside the visible edge. UniGetUI has none, so the outermost few pixels of the red Close fill show a resize cursor instead of closing the window. The alternative is the empty strip this issue reports.
Verification
dotnet format whitespaceanddotnet format stylewith--verify-no-changes: both exit 0.