Permalink
Browse files

Shared: Add DPI awareness manifest

This fixes issues with text scaling on Windows.

Note: only works with msvc compiles right now

CMake script comes from ouned/jk2mv and the manifest file is credits to ioquake3.
  • Loading branch information...
ensiform committed Nov 4, 2017
1 parent a0828f0 commit b5c3f14ad9c3f2395617f3477312f3b96729e5be
Showing with 53 additions and 0 deletions.
  1. +8 −0 code/CMakeLists.txt
  2. +8 −0 codemp/CMakeLists.txt
  3. +37 −0 shared/sys/win_manifest.xml
View
@@ -416,6 +416,14 @@ if(BuildSPEngine OR BuildJK2SPEngine)
endif()
endif(MakeApplicationBundles)
# add DPI awareness manifest
if(MSVC)
add_custom_command(TARGET ${ProjectName} POST_BUILD
COMMAND "mt.exe" -manifest \"${SharedDir}\\sys\\win_manifest.xml\" -inputresource:\"$<TARGET_FILE:${ProjectName}>\"\;\#1 -outputresource:\"$<TARGET_FILE:${ProjectName}>\"\;\#1
COMMENT "Adding manifest..."
)
endif()
set_target_properties(${ProjectName} PROPERTIES COMPILE_DEFINITIONS "${SPEngineDefines}")
# Hide symbols not explicitly marked public.
View
@@ -577,6 +577,14 @@ if(BuildMPEngine)
endif(MakeApplicationBundles)
endif(WIN32)
# add DPI awareness manifest
if(MSVC)
add_custom_command(TARGET ${MPEngine} POST_BUILD
COMMAND "mt.exe" -manifest \"${SharedDir}\\sys\\win_manifest.xml\" -inputresource:\"$<TARGET_FILE:${MPEngine}>\"\;\#1 -outputresource:\"$<TARGET_FILE:${MPEngine}>\"\;\#1
COMMENT "Adding manifest..."
)
endif()
if(MakeApplicationBundles)
install(TARGETS ${MPEngine}
BUNDLE
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*">
</assemblyIdentity>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- No id for Windows XP -->
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
</windowsSettings>
</application>
</assembly>

0 comments on commit b5c3f14

Please sign in to comment.