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

MaxAutoSizeHint on Windows limit PopupRoot to smaller width ou height when use multiple screens and default screen have lower resolution #18067

Open
douglaseds9 opened this issue Jan 29, 2025 · 1 comment
Labels
bug help-wanted A contribution from the community would be most welcome.

Comments

@douglaseds9
Copy link

Describe the bug

When using multiple screens and the default screen has a smaller width or height, the PopupRoot is limited to a smaller width or height. Although the expected behavior is MaxWidth and MaxHeight as the sum of the width and the sum of the height of the screens,
respectively, or something less limiting.

Image

public override Size MaxAutoSizeHint
{
get
{
if (_maxAutoSize is null)
{
var screen = base.Screen.ScreenFromHwnd(Hwnd, UnmanagedMethods.MONITOR.MONITOR_DEFAULTTONEAREST);
if (screen is not null)
{
_maxAutoSize = screen.WorkingArea.ToRect(RenderScaling).Size;
}
}
return _maxAutoSize ?? Size.Infinity;
}
}

To Reproduce

  1. Create a app with a Flyout;
  2. Run on multiple screens system with the lower resolution screen as default;
  3. Try to Flyout Width greater than smaller screen width.

Expected behavior

The Width of Flyout is not limited to a Width smaller than the Width of Window..

Image

Avalonia version

11.2.3

OS

Windows

@maxkatz6 maxkatz6 added help-wanted A contribution from the community would be most welcome. bug labels Jan 29, 2025
@KieranDevvs
Copy link
Contributor

KieranDevvs commented Feb 9, 2025

Can you please provide a minimal reproducible version of the XAML you're using to create the flyout?
I cannot replicate the behaviour from the steps you have provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help-wanted A contribution from the community would be most welcome.
Projects
None yet
Development

No branches or pull requests

3 participants