Patch #1:
function TPlatformCocoa.GetDisplayMetrics: TDeviceDisplayMetrics;
const
MacBasePPI = 110;
var
Screen: NSScreen;
ScreenSize: TPointF;
ScreenScale: Single;
begin
Screen := TNSScreen.Wrap(TNSScreen.OCClass.mainScreen);
ScreenSize := TPointF(Screen.frame.size);
// +++ add this
OS check +++
if NSAppKitVersionNumber >= NSAppKitVersionNumber10_7 then
ScreenScale := Screen.backingScaleFactor
else
ScreenScale := 1.0;
...
Patch #2:
function TPlatformCocoa.GetScreenScale: Single;
begin
// +++ add this
OS check +++
if NSAppKitVersionNumber >= NSAppKitVersionNumber10_7 then
Result := TNSScreen.Wrap(TNSScreen.OCClass.mainScreen).backingScaleFactor
else
Result := 1.0;
end;
Patch #3:
procedure AddDevices;
var
Screen: NSScreen;
Rect: NSRect;
LogicalSize, PhysicalSize: TSize;
Scale: CGFloat;
DeviceID: string;
begin
Screen := TNSScreen.Wrap(TNSScreen.OCClass.mainScreen);
Rect := Screen.frame;
// +++ check for MacOS 10.7 here +++
if NSAppKitVersionNumber >= NSAppKitVersionNumber10_7 then
Scale := Screen.backingScaleFactor
else
Scale := 1.0;
...