Skip to content

Fix size jitter of maximized or fullscreen window when dpi changes. #18936

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kkwpsv
Copy link
Contributor

@kkwpsv kkwpsv commented May 28, 2025

What does the pull request do?

Do not resize maximized or fullscreen window according to dpi, or window may be out of screen and resized by window manager again. This will cause size jitter.

What is the current behavior?

For example, my display config is 1920*1080 (pixel size) 150% dpi. And open a new fullscreen window.
The size will change as below:

Size DPI PixelSize
1440x707 100% 1440x707 Initial state, not important.
1920x1080 150% 2880x1620 window manager resize to 1920x1080(pixel size), but avalonia scale it according to dpi
1280x720 150% 1920x1080 resize back by window manager

What is the updated/expected behavior with this PR?

Now, the size will change as below:

Size DPI PixelSize
1440x707 100% 1440x707 Initial state, not important.
1280x720 150% 1920x1080 resize by window manager

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

As above.

Checklist

Breaking changes

None.

Obsoletions / Deprecations

None.

Fixed issues

None.

…dow may be out of screen and resized by window manager again.
@avaloniaui-bot
Copy link

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

@maxkatz6 maxkatz6 requested a review from kekekeks May 29, 2025 01:00
@maxkatz6 maxkatz6 added backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch and removed backported-11.3.x labels May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-x11 backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants