[Lazarus] Mac Hi-DPI 2

zeljko zeljko at holobit.net
Sat Mar 11 17:58:07 CET 2017


On 03/10/2017 12:54 PM, Ondrej Pokorny via Lazarus wrote:

> To me it looks like Carbon applications are scaled automatically by the
> OS. Something similar to what also Windows uses if you switch High-DPI
> awarness off.
>
> That means the regardless of your screen (retina, non-retina) the DPI is
> always 96. So there shouldn't be any LCL-scaling involved.

hm...just tested Qt4 and Qt5 on MacOSX.
Qt4 - MacOSX 10.8.6 32 bit (qt4 library uses carbon for it's widgets)
Qt5 - MacOSX 10.11 64 bit (qt5 library uses cocoa for it's widgets).

When Application.Scaled = False fonts of some controls are resized to 
smaller fonts (DesignTimePPI on both macs says 72 ) - so my question are 
here:
1. is 96dpi hardcoded somewhere, so it underscales some fonts in case 
when dpi is 72 - even with Application.Scaled := False. ?

2. Some forms eg. About lazarus is shown too small, seem that it's 
scaled to the smaller size because of dpi 72. (ide have 
application.scaled := True by default), also Find Dialog is reduced but 
all child controls of FindDialog haven't scaled fonts ,so dialog isn't 
sized well.

Note that both cases were fine before HiDPI changes, also please keep in 
mind that Lazarus OSX isn't carbon or cocoa only, but qt4 and qt5 too.

On linux and windows everything works pretty nice (Application.Scaled := 
true and Application.Scaled := false) with qt4 and qt5 widgetsets.

My app is designed on linux (96 dpi) and then just rebuilded on mac (if 
that matters), also Mac 10.8.6 is iMac with resolution 1440x900 72dpi, 
Mac 10.11 have resolution 1920x1200 72dpi (this one is running inside 
vmware).

Any hints ?

zeljko





More information about the Lazarus mailing list