foxygit / doom Log in
commit 5a8db1512bf95325d466086498b20474b769924f
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Mon Oct 28 03:37:26 2013 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Mon Oct 28 03:37:26 2013 +0000

    Declare Windows binaries as DPI-aware to prevent the OS from applying
    DPI virtualization.

    Subversion-branch: /branches/v2-branch
    Subversion-revision: 2727
---
 src/Makefile.am                 |  3 ++-
 src/manifest.xml                | 12 ++++++++++++
 src/resource.rc.in              |  2 ++
 src/setup/setup-manifest.xml.in |  9 +++++++++
 4 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 05245a46..2ba57fd5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -214,7 +214,8 @@ endif

 EXTRA_DIST =                        \
         icon.c                      \
-        doom-screensaver.desktop.in
+        doom-screensaver.desktop.in \
+        manifest.xml

 appdir = $(prefix)/share/applications
 app_DATA = @PROGRAM_PREFIX@doom.desktop
diff --git a/src/manifest.xml b/src/manifest.xml
new file mode 100644
index 00000000..05a19e7a
--- /dev/null
+++ b/src/manifest.xml
@@ -0,0 +1,12 @@
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
+
+  <!-- Declare app as DPI aware, so that Windows Vista and later will not
+       apply DPI virtualization. -->
+
+  <asmv3:application>
+    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
+      <dpiAware>true</dpiAware>
+    </asmv3:windowsSettings>
+  </asmv3:application>
+</assembly>
+
diff --git a/src/resource.rc.in b/src/resource.rc.in
index f8b64331..04af386e 100644
--- a/src/resource.rc.in
+++ b/src/resource.rc.in
@@ -1,5 +1,7 @@
 1 ICON "../data/doom.ico"

+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "manifest.xml"
+
 1 VERSIONINFO
 PRODUCTVERSION @WINDOWS_RC_VERSION@
 FILEVERSION @WINDOWS_RC_VERSION@
diff --git a/src/setup/setup-manifest.xml.in b/src/setup/setup-manifest.xml.in
index ff879263..5e5cb87c 100644
--- a/src/setup/setup-manifest.xml.in
+++ b/src/setup/setup-manifest.xml.in
@@ -29,5 +29,14 @@
       <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> <!-- Vista -->
     </application>
   </compatibility>
+
+  <!-- Declare app as DPI aware, so that Windows Vista and later will not
+       apply DPI virtualization. -->
+
+  <asmv3:application>
+    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
+      <dpiAware>true</dpiAware>
+    </asmv3:windowsSettings>
+  </asmv3:application>
 </assembly>