Browse Source

Merge pull request #5369 from AvaloniaUI/fixes/edid

Correctly read EDID on X11.
pull/5414/head
Steven Kirk 5 years ago
committed by GitHub
parent
commit
d53920bc99
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/Avalonia.X11/X11Atoms.cs
  2. 4
      src/Avalonia.X11/X11Screens.cs

2
src/Avalonia.X11/X11Atoms.cs

@ -114,7 +114,7 @@ namespace Avalonia.X11
public readonly IntPtr XA_WM_CLASS = (IntPtr)67;
public readonly IntPtr XA_WM_TRANSIENT_FOR = (IntPtr)68;
public readonly IntPtr RR_PROPERTY_RANDR_EDID = (IntPtr)82;
public readonly IntPtr EDID;
public readonly IntPtr WM_PROTOCOLS;
public readonly IntPtr WM_DELETE_WINDOW;

4
src/Avalonia.X11/X11Screens.cs

@ -91,12 +91,12 @@ namespace Avalonia.X11
var hasEDID = false;
for(var pc = 0; pc < propertyCount; pc++)
{
if(properties[pc] == _x11.Atoms.RR_PROPERTY_RANDR_EDID)
if(properties[pc] == _x11.Atoms.EDID)
hasEDID = true;
}
if(!hasEDID)
return null;
XRRGetOutputProperty(_x11.Display, rrOutput, _x11.Atoms.RR_PROPERTY_RANDR_EDID, 0, EDIDStructureLength, false, false, _x11.Atoms.AnyPropertyType, out IntPtr actualType, out int actualFormat, out int bytesAfter, out _, out IntPtr prop);
XRRGetOutputProperty(_x11.Display, rrOutput, _x11.Atoms.EDID, 0, EDIDStructureLength, false, false, _x11.Atoms.AnyPropertyType, out IntPtr actualType, out int actualFormat, out int bytesAfter, out _, out IntPtr prop);
if(actualType != _x11.Atoms.XA_INTEGER)
return null;
if(actualFormat != 8) // Expecting an byte array

Loading…
Cancel
Save