-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix: CanResize unused when Width/Height is set #12445
Conversation
@dotnet-policy-service agree |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
src/Avalonia.X11/X11Window.cs
Outdated
@@ -980,8 +991,10 @@ private void MoveResize(PixelPoint position, Size size, double scaling) | |||
|
|||
private void Resize(Size clientSize, bool force, WindowResizeReason reason) | |||
{ | |||
if (!force && clientSize == ClientSize) | |||
if (!force && (clientSize == ClientSize || (!_canResize && reason == WindowResizeReason.User))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reason == WindowResizeReason.User
Condition is never true
You can test this PR using the following package version. |
2 problems in X11Window.cs - In UpdateSizeHints: max and min sizes were set regardless of _canResize, if preResize is not null - In Resize, many things are set without checking for _canResize Added the check for _canResize, which stops the resizing if not forced (e.g. when a dialog needs a startup size) Make setting varying max and min exclusively when _canResize is false
You can test this PR using the following package version. |
Fix CanResize=false having no effect if Width or Height is set
Also the effect of Height and Width should not be nulled when CanResize=false is present
This behavior depends on the type of resize event. Avalonia should still resize when the monitor DPI changes, or when the components are laid out, or, as in the case of the bug, Width or Height is set programmatically.
Fixes #8329