Proper DPI awareness

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Rinzwind
Enthusiast
Enthusiast
Posts: 636
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Proper DPI awareness

Post by Rinzwind »

PB must improve it's DPI awareness and support Windows 10's DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2
To make this happen, the dev MUST have a hidpi display (4k) and 2k display next to each other and play around with windows, controls and moving them from monitor to monitor and change DPI settings. O, one app can contain multiple windows with different dpi depending on monitor. WindowsBounds... So many things that can go wrong ;)

Luckily for Fred (Last visited:Wed Feb 10, 2021 12:03 pm :o ): he can focus on Windows 10, since this is by now the only MS-supported OS!

Helpful links for Fred&co:
https://github.com/microsoft/Windows-cl ... ontext.cpp
https://github.com/tringi/win32-dpi/blo ... 32-dpi.cpp

And yes, DPI handling is a mess on Windows. Apple did it way more practical. Logical units everywhere instead of physical pixels... the OS takes care of it.

edit: including proper icon handling for buttons/menu's.

I would advise PB to let its API be handling positions and sizes in logical units, unless otherwise specified by a new flag.