Proper DPI awareness

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Rinzwind
Enthusiast
Enthusiast
Posts: 679
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.
Rinzwind
Enthusiast
Enthusiast
Posts: 679
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: Proper DPI awareness

Post by Rinzwind »

Any progress/attention given to this? Anyone with multiple monitors with different resolutions can find out the annoyances with this. Especially when you have to manually work around it as PB programmer. Thanks.
User avatar
HeX0R
Addict
Addict
Posts: 1189
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: Proper DPI awareness

Post by HeX0R »

+1
I agree, this is a pain since many years
User avatar
Caronte3D
Addict
Addict
Posts: 1355
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: Proper DPI awareness

Post by Caronte3D »

+1
mestnyi
Addict
Addict
Posts: 1098
Joined: Mon Nov 25, 2013 6:41 am

Re: Proper DPI awareness

Post by mestnyi »

+1
User avatar
Mijikai
Addict
Addict
Posts: 1517
Joined: Sun Sep 11, 2016 2:17 pm

Re: Proper DPI awareness

Post by Mijikai »

+1
Post Reply