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 - Only update window position on extended client changed when window is visible #14954

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

emmauss
Copy link
Contributor

@emmauss emmauss commented Mar 13, 2024

What does the pull request do?

Only sets frame margins when window is visible.

What is the current behavior?

Currently, when system decorations change, the window frame margins are updated, even if the window is not visible yet. If the window isn't shown yet, and the SystemDecoration property is set after Width/Height are set, it forces a size update, and ClientSize is set before the window's Width and Height is applied, thus discarding the Width/Height properties.

What is the updated/expected behavior with this PR?

If window isn't shown, and decorations have been set, update extended margins, but don't set position yet. But if it's being shown, force a frame update after the initial size is set.

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

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #14942

@avaloniaui-bot
Copy link

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

@emmauss emmauss force-pushed the fix/win32_force_frame_margin_shown branch from 2d1df9c to 207efa1 Compare March 13, 2024 14:52
@emmauss emmauss changed the title Win32 - Only update frame margins when window is visible Win32 - Only update window position on extended client changed when window is visible Mar 13, 2024
@emmauss emmauss force-pushed the fix/win32_force_frame_margin_shown branch from 207efa1 to 02ebadc Compare March 13, 2024 14:57
@avaloniaui-bot
Copy link

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

@emmauss emmauss force-pushed the fix/win32_force_frame_margin_shown branch from 02ebadc to 50a5f3e Compare March 18, 2024 11:30
@avaloniaui-bot
Copy link

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

@maxkatz6 maxkatz6 added this pull request to the merge queue Mar 18, 2024
@maxkatz6 maxkatz6 added bug os-windows backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Mar 18, 2024
Merged via the queue into master with commit 4c949ee Mar 18, 2024
7 checks passed
@maxkatz6 maxkatz6 deleted the fix/win32_force_frame_margin_shown branch March 18, 2024 19:07
@maxkatz6 maxkatz6 added backported-11.1.x and removed backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Apr 20, 2024

if (newProperties.Decorations == SystemDecorations.Full)
if (_shown || forceChanges)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line causes #16529. Remove it and the window opens at the correct location.

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.

Width and Height Window Properties are Ignored when SystemDecorations is Set to BorderOnly
4 participants