-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Crash at start with 5120x1440 on linux #5124
Comments
The issue is caused by the broken EDID off my monitor, it doesn't report physical size of the monitor on 5120x1440, so randr reports a monitorsize of 1mm x 1mm.
|
Please, show the output of |
Here is the output, i removed unused modelines and disconnected displays to shorten the output.
I think the fundamental issue is that avalonia attempts to guess the scalingfactor from resolution of the screen and its physical size, but that has no meaning to the actual scaling used by the Desktop Environment or randr. var monitors = XRRGetMonitors(_x11.Display, _window, true, out var count);
var screens = new X11Screen[count];
for (var c = 0; c < count; c++)
{
var mon = monitors[c];
var namePtr = XGetAtomName(_x11.Display, mon.Name);
var name = Marshal.PtrToStringAnsi(namePtr);
XFree(namePtr);
var density = 1d;
if (_settings.NamedScaleFactors?.TryGetValue(name, out density) != true)
{
if (mon.MWidth == 0)
density = 1;
else
density = X11Screen.GuessPixelDensity(mon.Width, mon.MWidth);
}
density *= _settings.GlobalScaleFactor;
var bounds = new PixelRect(mon.X, mon.Y, mon.Width, mon.Height);
screens[c] = new X11Screen(bounds,
mon.Primary != 0,
name,
(mon.MWidth == 0 || mon.MHeight == 0) ? (Size?)null : new Size(mon.MWidth, mon.MHeight),
density);
} The guessed var monitor = _platform.X11Screens.Screens.OrderBy(x => x.PixelDensity)
.FirstOrDefault(m => m.Bounds.Contains(Position));
newScaling = monitor?.PixelDensity ?? RenderScaling; As far as i can tell randrs scaling is invisible to applications and should not be handled by applications.
And then there is window scaling implemented through the Desktop Enviroment(GNOME,KDE,XFCE,...), this seems to be completely ignored.
I believe the proper way to detect the window scaling should be: Link to ArchWiki about HiDPI: https://wiki.archlinux.org/index.php/HiDPI#Xorg |
IIRC desktop environments are intentionally not implementing per-monitor DPI for X11 to force migration to Wayland |
I guess we should limit the auto-detected scaling to 300% or something |
I think its better to detect the screen scaling factor in a more reliable way, and then fallback to 100%. QEdidParser Here is a shortened decode EDID from my monitor to show why this would work:
Maximum image size is correct as is the mapped size for |
Avalonia crashes at start even with a template app (just a empty window), when i am using the native resolution.
When using resolution below (3840x1080) it works.
I can cross out the window manager as this happens on XFCE and Openbox.
I have no idea if this is a general Issue or if something is broken/misconfigured on my side.
Any clues?
System Information:
OS: Manjaro Linux x86_64
Kernel: 5.4.80-2-MANJARO
X.Org: 1.20.9
Nvidia Driver: 450.80.02 (i also tried 455.45.01)
Exceptions:
0.9.12:
0.10.0-preview6:
The text was updated successfully, but these errors were encountered: