Skip to content
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

Merged
merged 2 commits into from
Sep 25, 2023
Merged

Bugfix: CanResize unused when Width/Height is set #12445

merged 2 commits into from
Sep 25, 2023

Conversation

uthidata
Copy link
Contributor

@uthidata uthidata commented Aug 5, 2023

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

@uthidata
Copy link
Contributor Author

uthidata commented Aug 5, 2023

@dotnet-policy-service agree

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0038320-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0038330-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0038332-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 requested review from kekekeks and jmacato August 6, 2023 01:10
@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0038348-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0038422-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0039145-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@timunie
Copy link
Contributor

timunie commented Sep 4, 2023

ping @kekekeks @jmacato

@@ -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)))
Copy link
Member

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

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0039929-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

stepangovorko and others added 2 commits September 25, 2023 02:06
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
@maxkatz6 maxkatz6 enabled auto-merge September 25, 2023 00:12
@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0039933-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 added this pull request to the merge queue Sep 25, 2023
Merged via the queue into AvaloniaUI:master with commit 5113b70 Sep 25, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CanResize has no effect in Linux
6 participants