Win10 DPI scaling trouble

i found in win10 , that , user32.dll --> GetSystemMetrics doesn’t get correct screen resolution if DPI scaling is not 100%.
and win10 doesn’t scale my Panda3d gfx window.
in case i want a panda3d app in window mode, how can i get the correct window size?
and can win10 by itself scale a 3d gfx window - without gfx engine doing anything?

This was addressed in Panda3D 1.9.1. Panda should return the “real” display size in 1.9.1 and above by default, and the previous behaviour can be enabled using a config variable.

To restore the pre-1.9.1 behaviour, set this variable in Config.prc:

dpi-aware false

Then Windows will scale your window as it did before 1.9.1, but Panda will look more pixely, so I don’t recommend it.

Please read this blog post:

i didn’t realize the DPI issue at all before i ran my app in win10. strange that in win8 there was not the problem even though my DPI setting was 125% in both win8 and win10.

in case screen resolution should be detected before Panda3D is imported, one can call
to make the Python process aware of DPI, then user32.GetSystemMetrics will return the true screen resolution.

Okay, but if you do that, I suggest adding a check whether the function exists before calling it, since it’s not available before Windows 8.1.