Repository navigation
Hit-test the resize border instead of borrowing Avalonia's - #5474
Merged
Gabriel Dufresne (GabrielDuf) merged 1 commit intoOct 5, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Caption-button hit testing takes precedence and prevents resizing along overlapping top-right borders.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds custom Win32 resize-border hit testing for the Avalonia main window.
Changes:
- Detects all resize edges and corners.
- Handles
WM_NCHITTESTusing calculated border regions. - Adds
GetWindowRectinterop.
| File | Description |
|---|---|
src/UniGetUI.Avalonia/Views/MainWindow.axaml.cs |
Implements native resize-border hit testing and required interop. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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": "fd8de190-c0df-11f1-8c95-f112a5288bc6",
"headSha": "c870d0f6381c68245212aaa9cdfeb34ea865d03b",
"reviewer": "copilot-pull-request-reviewer[bot]"
}
Gabriel Dufresne (GabrielDuf)
deleted the
fix/5471-window-resize-border-hit-test
branch
October 5, 2026 17:13
4 tasks done
4 tasks done
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.

This pull request adds logic to improve window resizing behavior by implementing custom hit testing for the window borders. The main changes include defining additional hit test constants, adding a new
HitTestResizeBordermethod, integrating this logic into the window procedure, and adding a native interop method for retrieving the window rectangle.Window resizing and hit testing improvements:
HTLEFT,HTRIGHT,HTTOP,HTTOPLEFT,HTTOPRIGHT,HTBOTTOM,HTBOTTOMLEFT,HTBOTTOMRIGHT,HTNOWHERE) to support more precise window edge detection.HitTestResizeBordermethod to determine which border or corner of the window is being interacted with, enabling custom resize behavior.OnWindowsWndProc) to handleWM_NCHITTESTmessages and return the appropriate hit test result, allowing for correct window resizing from all edges and corners.Native interop enhancements:
GetWindowRectin theNativeMethodsclass to retrieve the window's dimensions, which is used in the hit testing logic.