Closed cjee21 closed 4 months ago
In theory LOGPIXELSY
should be used for the height but I guess this is a corner case, but not blocking.
In theory
LOGPIXELSY
should be used for the height but I guess this is a corner case, but not blocking.
Isn't X or Y having same DPI? There is only one DPI setting.
Isn't X or Y having same DPI? There is only one DPI setting.
I bet that in practice they are same for 99.999% of devices but my understanding of the theory is that you can get 2 different values between width and height with this API.
There is only one DPI setting.
With this API there are 2, LOGPIXELSX
("Number of pixels per logical inch along the screen width.") and LOGPIXELSY
("Number of pixels per logical inch along the screen height.")
With this API there are 2,
LOGPIXELSX
("Number of pixels per logical inch along the screen width.") andLOGPIXELSY
("Number of pixels per logical inch along the screen height.")
As far as I know, there is no way in Windows to set different DPI for X and Y. So I don't know if it is possible to have two different values for that API. Wonder why it has two though.
Wonder why it has two though.
I bet that they expected to manage non square pixels (it is currently part of the past for TV only but it could return one day in computer screens... Or not) at some point and that it was abandoned in the meantime.
I bet that they expected to manage non square pixels (it is currently part of the past for TV only but it could return one day in computer screens... Or not) at some point and that it was abandoned in the meantime.
Probably because it seems this API can be used for printers too. Maybe printers can have different X and Y.
Tested on a single monitor at 100 - 200% DPI scale on Windows 11 23H2 and it works the same as when using the other API.
Please update with #858 (comment) ASAP, then I merge and do a new public version.
Alright.
Argh the space and tab issue again. 😓
Use older API to get system DPI for taking DPI scaling into account when setting window size so that it works on older Windows versions.