classification
Title: Python 3.4.3 64 bits is not "high dpi aware"
Type: behavior Stage: resolved
Components: Windows Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, cheryl.sabella, ivb, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2015-06-06 09:20 by ivb, last changed 2018-12-22 22:45 by cheryl.sabella. This issue is now closed.

Messages (6)
msg244894 - (view) Author: Ivan Bykov (ivb) Date: 2015-06-06 09:20
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"'
msg244995 - (view) Author: Ivan Bykov (ivb) Date: 2015-06-08 10:13
https://msdn.microsoft.com/en-us/library/windows/desktop/dn469266(v=vs.85).aspx#declaring_dpi_awareness

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
  <asmv3:application>
    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
      <dpiAware>true</dpiAware>
    </asmv3:windowsSettings>
  </asmv3:application>
</assembly>
msg245053 - (view) Author: Ivan Bykov (ivb) Date: 2015-06-09 09:26
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
msg245054 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2015-06-09 09:35
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
msg245058 - (view) Author: Ivan Bykov (ivb) Date: 2015-06-09 10:26
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
msg332374 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2018-12-22 22:45
IDLE added a call to the Windows API in #33656.  Other than that, as Amaury stated, there isn't any UI in Python, so closing this as not a bug.
History
Date User Action Args
2018-12-22 22:45:15cheryl.sabellasetstatus: open -> closed

nosy: + cheryl.sabella
messages: + msg332374

resolution: not a bug
stage: resolved
2015-06-09 10:26:36ivbsetmessages: + msg245058
2015-06-09 09:35:53amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg245054
2015-06-09 09:26:08ivbsetmessages: + msg245053
versions: + Python 3.5
2015-06-08 10:13:16ivbsetmessages: + msg244995
2015-06-06 09:20:26ivbcreate