Skip to content

Fix Window.Show when MinWidth > MaxWidth #18604

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

Merged
merged 3 commits into from
Apr 8, 2025

Conversation

MrJul
Copy link
Member

@MrJul MrJul commented Apr 7, 2025

What does the pull request do?

This PR fixes Window.Show throwing in 11.3 when MinWidth is greater than MaxWidth (also applies to MinHeight/MaxHeight).

This used to work in previous versions: the issue was introduced by #16158.

A unit test has been added.

This PR also changes AboutAvaloniaDialog, which had wrong dimensions (and where the bug was found).

What is the current behavior?

Having MinWidth/Height greater than MaxWidth/MaxHeight throws.

What is the updated/expected behavior with this PR?

Having MinWidth/Height greater than MaxWidth/MaxHeight works, with the maximum value winning.

How was the solution implemented (if it's not obvious)?

The existing internal MinMax structure is used, which already coerces the values properly.

@MrJul MrJul added bug regression backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch labels Apr 7, 2025
@avaloniaui-bot
Copy link

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

@MrJul MrJul added this pull request to the merge queue Apr 8, 2025
Merged via the queue into AvaloniaUI:master with commit 5dddd6f Apr 8, 2025
11 checks passed
@MrJul MrJul deleted the fix/window-min-max branch April 8, 2025 09:03
MrJul added a commit that referenced this pull request Apr 12, 2025
* Add failing Window test

* Fix Window.Show when MinWidth > MaxWidth

* Fix AboutAvaloniaDialog size constraints
@MrJul MrJul added backported-11.3.x and removed backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch labels Apr 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants