Skip to content
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

Closed
ivb mannequin opened this issue Jun 6, 2015 · 6 comments
Closed

Python 3.4.3 64 bits is not "high dpi aware" #68578

ivb mannequin opened this issue Jun 6, 2015 · 6 comments
Labels
OS-windows type-bug An unexpected behavior, bug, or error

Comments

@ivb
Copy link
Mannequin

ivb mannequin commented Jun 6, 2015

BPO 24390
Nosy @amauryfa, @tjguk, @zware, @zooba, @csabella

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:

assignee = None
closed_at = <Date 2018-12-22.22:45:15.415>
created_at = <Date 2015-06-06.09:20:26.723>
labels = ['type-bug', 'invalid', 'OS-windows']
title = 'Python 3.4.3 64 bits is not "high dpi aware"'
updated_at = <Date 2018-12-22.22:45:15.414>
user = 'https://bugs.python.org/ivb'

bugs.python.org fields:

activity = <Date 2018-12-22.22:45:15.414>
actor = 'cheryl.sabella'
assignee = 'none'
closed = True
closed_date = <Date 2018-12-22.22:45:15.415>
closer = 'cheryl.sabella'
components = ['Windows']
creation = <Date 2015-06-06.09:20:26.723>
creator = 'ivb'
dependencies = []
files = []
hgrepos = []
issue_num = 24390
keywords = []
message_count = 6.0
messages = ['244894', '244995', '245053', '245054', '245058', '332374']
nosy_count = 6.0
nosy_names = ['amaury.forgeotdarc', 'tim.golden', 'ivb', 'zach.ware', 'steve.dower', 'cheryl.sabella']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue24390'
versions = ['Python 3.4', 'Python 3.5']

@ivb
Copy link
Mannequin Author

ivb mannequin commented Jun 6, 2015

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"'

@ivb ivb mannequin added OS-windows type-bug An unexpected behavior, bug, or error labels Jun 6, 2015
@ivb
Copy link
Mannequin Author

ivb mannequin commented Jun 8, 2015

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>

@ivb
Copy link
Mannequin Author

ivb mannequin commented Jun 9, 2015

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

@amauryfa
Copy link
Member

amauryfa commented Jun 9, 2015

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

@ivb
Copy link
Mannequin Author

ivb mannequin commented Jun 9, 2015

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

@csabella
Copy link
Contributor

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants