helloSystem / ISO

helloSystem Live and installation ISO
https://github.com/helloSystem/
BSD 3-Clause "New" or "Revised" License
807 stars 58 forks source link

HiDPI not working with 27" 4k display (change dpi threshold) #236

Closed jolonf closed 3 years ago

jolonf commented 3 years ago

HiDPI is not enabled on 27" 4k display.

HiDPI logic is here: https://github.com/helloSystem/ISO/blob/1a1c4075d5b730c81c778bfd19ec7bd2b2ffdf09/overlays/uzip/hello/files/usr/local/bin/start-hello#L193

HiDPI is only set if dpi > 200. My display has a dpi of 161 and therefore HiDPI is not turned on.

Without HiDPI everything is too small to read. Note that macOS automatically turns on HiDPI for any 4k display.

It's worth noting that traditionally displays were 72 dpi, so 2x would be 144 dpi. I changed the value from 200 to 140 and HiDPI becomes enabled for my display.

For comparison a 27" 2560x1440 QHD display has a dpi of 109. This would be the next smaller resolution for a 27" display (below 4k).

A threshold dpi of 160 could be fine although it may depend on what size various monitors report. My LG reports 34cm vertical size, however it seems to measure 33.5cm. So a value of around 140 - 150 may be safer.

Just another thought on the dpi issue, not only should HiDPI depend on pixel density but it should also depend on the distance from the screen. For example a 55" 4k TV has very low pixel density, but you might be sitting 10 times farther away from the screen, in which case the pixel density increases. Ideally there should be a user setting for HiDPI. But I think the setting should err towards HiDPI as that is the trend of displays.

Additional issue: cursor is not enlarged 2x nor are the coloured buttons in the window title bars.

ISO version r0.5.0

probonopd commented 3 years ago

Thank you @jolonf

probonopd commented 3 years ago

This breaks on Acer TravelMate M which calculates 153dpi (768 vertical pixels, 14 vertical cm) and is definitely not HiDPI. Hence increasing the threshold to 160dpi for now.