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

Win32: fix position being changed on Resize while minimized #17559

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

MrJul
Copy link
Member

@MrJul MrJul commented Nov 19, 2024

What does the pull request do?

On Windows, this PR fixes the window's bounds being incorrectly changed if WindowImpl.Resize() gets called while the window is minimized (this can happen as a result of InvalidateMeasure()). This issue was introduced in #14470.

Two things were wrong in this case:

  • The restore position was being set to the minimized position (-32000,-32000), causing Windows to always reposition the window at 0,0 instead when restoring it. This effectively always moved the window to the main screen.
  • If the window was maximized before being minimized, the restore size was incorrectly set to the maximized size.

@MrJul MrJul added bug os-windows customer-priority Issue reported by a customer with a support agreement. backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Nov 19, 2024
@avaloniaui-bot
Copy link

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

@maxkatz6 maxkatz6 added this pull request to the merge queue Nov 20, 2024
Merged via the queue into AvaloniaUI:master with commit a7c3ad9 Nov 20, 2024
11 checks passed
@TomEdwardsEnscape
Copy link
Contributor

Has #13300 (which the original changes fixed) been retested with these changes?

@MrJul
Copy link
Member Author

MrJul commented Nov 20, 2024

Has #13300 (which the original changes fixed) been retested with these changes?

Absolutely! In fact the code from that issue was used as a basis for testing the changes.

@maxkatz6 maxkatz6 added backported-11.2.x and removed backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Nov 26, 2024
@MrJul MrJul deleted the fix/win32-minimized-position branch December 21, 2024 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported-11.2.x bug customer-priority Issue reported by a customer with a support agreement. os-windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants