[pan: 9/15] Add a manifest file to control dpi scaling




commit 84856202d0a8bb4fe204722f43587572b63f2687
Author: Thomas Tanner <thosrtanner googlemail com>
Date:   Wed Apr 27 21:24:09 2022 +0100

    Add a manifest file to control dpi scaling

 pan/gui/Makefile.am      | 3 ++-
 pan/gui/pan.manifest.xml | 9 +++++++++
 pan/gui/panrc.rc         | 3 +++
 3 files changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/pan/gui/Makefile.am b/pan/gui/Makefile.am
index f2a041d..a7d40ae 100644
--- a/pan/gui/Makefile.am
+++ b/pan/gui/Makefile.am
@@ -94,7 +94,8 @@ bin_PROGRAMS = \
 
 if HAVE_WIN32
 WINRC = panrc.rc
-#WINRCOBJ = $(WINRC:.rc=.o)
+WINRCOBJ = $(WINRC:.rc=.o)
+$(WINRCOBJ): pan.manifest.xml
 .rc.o: ../../config.h $(srcdir)/pan/icons/Pan.ico
        $(WINDRES) -I . -I $(srcdir) -o $@ -i $<
 WINLIBS = -liconv
diff --git a/pan/gui/pan.manifest.xml b/pan/gui/pan.manifest.xml
new file mode 100644
index 0000000..708b32c
--- /dev/null
+++ b/pan/gui/pan.manifest.xml
@@ -0,0 +1,9 @@
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1"  xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" 
manifestVersion="1.0">
+  <asmv3:application>
+    <!-- gtk3 doesn't support fractional scaling though it doesn't seem
+         to be a problem for gtk2 -->
+    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings";>
+      <dpiAware>false</dpiAware>
+    </asmv3:windowsSettings>
+  </asmv3:application>
+</assembly>
diff --git a/pan/gui/panrc.rc b/pan/gui/panrc.rc
index e283a51..9675a07 100644
--- a/pan/gui/panrc.rc
+++ b/pan/gui/panrc.rc
@@ -1,5 +1,6 @@
 // Wormux resource for win32 target
 
+#include <winuser.h>
 #include <winver.h>
 #include "../../config.h"
 #if ENABLE_NLS
@@ -44,3 +45,5 @@ FILETYPE VFT_APP
 }
 
 IDI_ICON1 ICON DISCARDABLE "../icons/Pan.ico"
+
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "pan.manifest.xml"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]