Skip to content

Commit 8cf134e

Browse files
authored
Merge d142fae into 7c08cf5
2 parents 7c08cf5 + d142fae commit 8cf134e

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

source/core.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,12 @@ def main():
424424
"""
425425
log.debug("Core starting")
426426

427-
ctypes.windll.user32.SetProcessDPIAware()
427+
if winVersion.getWinVer() >= winVersion.WIN10_1703:
428+
ctypes.windll.user32.SetProcessDpiAwarenessContext(-4) # DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2
429+
elif winVersion.getWinVer() >= winVersion.WIN81:
430+
ctypes.windll.shcore.SetProcessDpiAwareness(2) # PROCESS_PER_MONITOR_DPI_AWARE
431+
else:
432+
ctypes.windll.user32.SetProcessDPIAware()
428433

429434
import config
430435
if not globalVars.appArgs.configPath:

source/setup.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
RT_MANIFEST = 24
3333
manifest_template = """\
3434
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
35-
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
35+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"
36+
xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
3637
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
3738
<security>
3839
<requestedPrivileges>
@@ -63,6 +64,16 @@
6364
/>
6465
</application>
6566
</compatibility>
67+
<asmv3:application>
68+
<asmv3:windowsSettings>
69+
<dpiAware
70+
xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"
71+
>true/pm</dpiAware>
72+
<dpiAwareness
73+
xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings"
74+
>PerMonitorV2, PerMonitor</dpiAwareness>
75+
</asmv3:windowsSettings>
76+
</asmv3:application>
6677
</assembly>
6778
"""
6879

0 commit comments

Comments
 (0)