Open TomEdwardsEnscape opened 9 months ago
I was able to confirm this as well, however,
For example, the following does NOT produce the error:
new Window()
{
Position = new(2799, 111),
Width = 500,
Height = 500,
Content = new Border { Width = 500, Height =500, Background = Brushes.Red }
}.Show();
Could you try changing the dpi awareness?
.With(new Win32PlatformOptions()
{
DpiAwareness = Win32DpiAwareness.SystemDpiAware
})
The default is PerMonitorDpiAware
Could you try changing the dpi awareness?
This works, at the cost of Avalonia windows no longer changing DPI when moved between monitors.
When you say the Window changes Size, is it relative to the scale? i.e. a 500x500 window on 100% scaling will become 750x750 on a 150% scaling monitor? If so, I think that's expected behavior, esp when moving between screens
This is on top of pixel scaling. The Avalonia Width and Height properties change, which is incorrect. The screenshot in the bug demonstrates the issue: the window should be the same size as the red square.
The same behaviour does not occur when dragging the window between screens manually.
When you say the Window changes Size, is it relative to the scale? i.e. a 500x500 window on 100% scaling will become 750x750 on a 150% scaling monitor? If so, I think that's expected behavior, esp when moving between screens
It's not even the same shape. In his demo above, the window starts the exact size of the red square and then basically resets to default window size when moved. This isn't scaling because it goes from a perfect square to a rectangle. I saw the same thing when I tried it.
You will need two monitors to reproduce this bug.
Position
value so that the window moves to the second monitor.The window becomes too large. Result on a 150% DPI monitor:
Workaround: set
MaxWidth
andMaxHeight
.Expected behavior
A window's public
Width
andHeight
properties should not change when it is moved to a new screen.Environment