New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 3.4.3 64 bits is not "high dpi aware" #68578
Comments
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> SM_CYSCREEN = 1
>>> from ctypes import windll
>>> GetSystemMetrics = windll.user32.GetSystemMetrics
>>> GetSystemMetrics(SM_CYSCREEN)
1067
>>> 'really this value is 1600'
>>> 'executable must be labeled as "high dpi aware"' |
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" > |
Python 3.5.0b2 (v3.5.0b2:7a088af5615b, May 31 2015, 06:22:19) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import ctypes
>>> ctypes.windll.user32.GetSystemMetrics(1)
1067
>>> #must be 1600
>>> #Python 3.5 also affected |
The Python program itself has no UI and cannot be marked as "DPI aware". Instead, applications should call the win32 function "SetProcessDPIAwareness": https://msdn.microsoft.com/en-us/library/windows/desktop/dn302122 |
SetProcessDpiAwareness not available for Windows 7. For Windows 7 available SetProcessDPIAware, but: Note SetProcessDPIAware is subject to a possible *race* *condition* if a DLL caches dpi settings during initialization. For this reason, it is recommended that dpi-aware be set through the application (.exe) *manifest* rather than by calling SetProcessDPIAware. https://msdn.microsoft.com/en-us/library/windows/desktop/ms633543%28v=vs.85%29.aspx |
IDLE added a call to the Windows API in bpo-33656. Other than that, as Amaury stated, there isn't any UI in Python, so closing this as not a bug. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: