From 93950031b92b18e35c1e5fba920f6047984ee210 Mon Sep 17 00:00:00 2001 From: myT Date: Wed, 29 Nov 2017 18:29:23 +0100 Subject: [PATCH] disabled DPI scaling on the Windows client --- changelog.txt | 2 ++ code/win32/client.manifest | 2 ++ code/win32/client_manifest.txt | 17 +++++++++++++++++ makefiles/premake5.lua | 3 +++ makefiles/vs2013/cnq3.vcxproj | 9 ++++----- makefiles/vs2013/cnq3.vcxproj.filters | 3 --- makefiles/vs2013/renderer.vcxproj | 1 - 7 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 code/win32/client.manifest create mode 100644 code/win32/client_manifest.txt diff --git a/changelog.txt b/changelog.txt index 45c3bf4..0884918 100644 --- a/changelog.txt +++ b/changelog.txt @@ -165,6 +165,8 @@ chg: remove the byzantine r_mode usage added in 1.47 Windows: +fix: disabled DPI scaling on the client + add: in_minimize registers a hotkey to minimize/restore the client key names must be separated by white space and there can be at most 2 modifier keys diff --git a/code/win32/client.manifest b/code/win32/client.manifest new file mode 100644 index 0000000..8af1fec --- /dev/null +++ b/code/win32/client.manifest @@ -0,0 +1,2 @@ + +True/PM \ No newline at end of file diff --git a/code/win32/client_manifest.txt b/code/win32/client_manifest.txt new file mode 100644 index 0000000..ad7d730 --- /dev/null +++ b/code/win32/client_manifest.txt @@ -0,0 +1,17 @@ +We embed a manifest in the client executables to disable DPI scaling. + +There are 2 settings to do so: +a) True/PM +b) PerMonitor +Note that the 2 XML namespaces are actually slightly different. + +"dpiAwareness" is only used for Windows 10 v1607 or later and overrides "dpiAware". +Since "dpiAware" is currently enough for every OS CNQ3 currently ships on, we don't use "dpiAwareness" (for now). + +"dpiAware" "True/PM" means: +- system DPI aware on Vista, 7 and 8.0 +- per-monitor DPI aware on 8.1 and 10 + +Why only system DPI aware on Vista, 7 and 8.0? +Because they don't support changing DPI scaling on the fly. +You have to log off and log in for the changes to take effect. diff --git a/makefiles/premake5.lua b/makefiles/premake5.lua index 294f678..bb843aa 100644 --- a/makefiles/premake5.lua +++ b/makefiles/premake5.lua @@ -483,6 +483,9 @@ local function ApplyExeProjectSettings(exeName, server) -- LINK accepts .res files directly filter "action:vs*" linkoptions { path.translate(make_path_src.."/win32/winquake.res", "\\"), "/STACK:8388608" } + if (server == 0) then + linkoptions { "/MANIFEST:EMBED", "/MANIFESTINPUT:"..path.translate(make_path_src.."/win32/client.manifest", "\\") } + end filter { "action:vs*", "configurations:release" } linkoptions { "/OPT:REF", "/OPT:ICF" } diff --git a/makefiles/vs2013/cnq3.vcxproj b/makefiles/vs2013/cnq3.vcxproj index 7f5429c..da16766 100644 --- a/makefiles/vs2013/cnq3.vcxproj +++ b/makefiles/vs2013/cnq3.vcxproj @@ -118,7 +118,7 @@ true Winmm.lib;ws2_32.lib;Version.lib;opengl32.lib;%(AdditionalDependencies) ..\..\.build\debug_x32;%(AdditionalLibraryDirectories) - ..\..\code\win32\winquake.res /STACK:8388608 %(AdditionalOptions) + ..\..\code\win32\winquake.res /STACK:8388608 /MANIFEST:EMBED /MANIFESTINPUT:..\..\code\win32\client.manifest %(AdditionalOptions) "..\create_git_header.cmd" "..\..\code\qcommon\git.h" @@ -147,7 +147,7 @@ copy "..\..\.bin\debug_x32\cnq3-x86.pdb" "$(QUAKE3DIR)" true Winmm.lib;ws2_32.lib;Version.lib;opengl32.lib;%(AdditionalDependencies) ..\..\.build\debug_x64;%(AdditionalLibraryDirectories) - ..\..\code\win32\winquake.res /STACK:8388608 %(AdditionalOptions) + ..\..\code\win32\winquake.res /STACK:8388608 /MANIFEST:EMBED /MANIFESTINPUT:..\..\code\win32\client.manifest %(AdditionalOptions) "..\create_git_header.cmd" "..\..\code\qcommon\git.h" @@ -187,7 +187,7 @@ copy "..\..\.bin\debug_x64\cnq3-x64.pdb" "$(QUAKE3DIR)" true Winmm.lib;ws2_32.lib;Version.lib;opengl32.lib;%(AdditionalDependencies) ..\..\.build\release_x32;%(AdditionalLibraryDirectories) - ..\..\code\win32\winquake.res /STACK:8388608 /OPT:REF /OPT:ICF %(AdditionalOptions) + ..\..\code\win32\winquake.res /STACK:8388608 /MANIFEST:EMBED /MANIFESTINPUT:..\..\code\win32\client.manifest /OPT:REF /OPT:ICF %(AdditionalOptions) "..\create_git_header.cmd" "..\..\code\qcommon\git.h" @@ -226,7 +226,7 @@ copy "..\..\.bin\release_x32\cnq3-x86.pdb" "$(QUAKE3DIR)" true Winmm.lib;ws2_32.lib;Version.lib;opengl32.lib;%(AdditionalDependencies) ..\..\.build\release_x64;%(AdditionalLibraryDirectories) - ..\..\code\win32\winquake.res /STACK:8388608 /OPT:REF /OPT:ICF %(AdditionalOptions) + ..\..\code\win32\winquake.res /STACK:8388608 /MANIFEST:EMBED /MANIFESTINPUT:..\..\code\win32\client.manifest /OPT:REF /OPT:ICF %(AdditionalOptions) "..\create_git_header.cmd" "..\..\code\qcommon\git.h" @@ -299,7 +299,6 @@ copy "..\..\.bin\release_x64\cnq3-x64.pdb" "$(QUAKE3DIR)" - diff --git a/makefiles/vs2013/cnq3.vcxproj.filters b/makefiles/vs2013/cnq3.vcxproj.filters index 17234ab..4bcdc87 100644 --- a/makefiles/vs2013/cnq3.vcxproj.filters +++ b/makefiles/vs2013/cnq3.vcxproj.filters @@ -210,9 +210,6 @@ renderer - - renderer - renderer diff --git a/makefiles/vs2013/renderer.vcxproj b/makefiles/vs2013/renderer.vcxproj index ea98c7f..a36556a 100644 --- a/makefiles/vs2013/renderer.vcxproj +++ b/makefiles/vs2013/renderer.vcxproj @@ -206,7 +206,6 @@ -