When running setup on my device (Windows 11, connected with 2 screens which use 
different DPI revolutions), the setup appears bluury on my secondary screen 
(not on the primary screen).

Because current setup.exe.manifest just set the dpiAware element, which causes 
the setup cannot handle different DPI on different screen, the current solution 
is to add dpiAwareness element and change the value of dpiAware to true/pm to 
handle DPI in per-moniter mode (patch attached). More infomation can be found 
at 
https://learn.microsoft.com/windows/win32/sbscs/application-manifests#dpiAware 
and 
https://learn.microsoft.com/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows<https://learn.microsoft.com/zh-cn/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows>

Also, the necessary options to use the Unicode version of the Windows API 
functions is also added in another patch to avoid localized message is 
incorrectly encoded when using the --lang option.

>From b9d42a8fa57f76e637672f1772780f21eb17da57 Mon Sep 17 00:00:00 2001
From: Yang Yulin <yyloffic...@hotmail.com>
Date: Sun, 7 Jul 2024 09:07:58 +0800
Subject: [PATCH setup 1/2] Added Unicode Support

---
 Makefile.am | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 72c6610..5afea69 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,13 +22,13 @@ SUBDIRS := @subdirs@ tests
 BASECXXFLAGS = -Werror -Wall -Wpointer-arith -Wcomments \
               -Wcast-align -Wwrite-strings -fno-builtin-sscanf \
               -Wno-attributes
-AM_CXXFLAGS = $(BASECXXFLAGS) -std=gnu++11 ${$(*F)_CXXFLAGS}
+AM_CXXFLAGS = $(BASECXXFLAGS) -std=gnu++11 -municode ${$(*F)_CXXFLAGS}
 AM_CFLAGS = $(BASECXXFLAGS) -Wmissing-declarations -Winline \
-           -Wstrict-prototypes -Wmissing-prototypes
+           -Wstrict-prototypes -Wmissing-prototypes -municode
 AM_YFLAGS = -d
 AM_LFLAGS = -8
 WINDRES = @WINDRES@
-AM_CPPFLAGS = -D__USE_MINGW_ANSI_STDIO=1 -D_FILE_OFFSET_BITS=64 
-DLZMA_API_STATIC \
+AM_CPPFLAGS = -D__USE_MINGW_ANSI_STDIO=1 -D_FILE_OFFSET_BITS=64 
-DLZMA_API_STATIC -DUNICODE -D_UNICODE \
               -I$(srcdir)/libgetopt++/include \
               $(ZLIB_CFLAGS) $(LZMA_CFLAGS) $(ZSTD_CFLAGS) $(LIBCRYPT_CFLAGS) 
$(LIBSOLV_CFLAGS)

--
2.45.2.windows.1


>From 288e01f0c55e6aa5a9f93b0a633278a2ca1d8d6a Mon Sep 17 00:00:00 2001
From: Yang Yulin <yyloffic...@hotmail.com>
Date: Sun, 7 Jul 2024 09:37:05 +0800
Subject: [PATCH setup 2/2] Added dpiAwareness Element to Manifest

This causes top-level and child HWNDs are notified of DPI change,
which keeps the content of window not appear blurry when changing DPI.
---
 setup.exe.manifest | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/setup.exe.manifest b/setup.exe.manifest
index 45a5f08..f3820fa 100755
--- a/setup.exe.manifest
+++ b/setup.exe.manifest
@@ -40,8 +40,9 @@
     </application>
   </compatibility>
   <asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
-    <asmv3:windowsSettings 
xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings";>
-      <dpiAware>true</dpiAware>
+    <asmv3:windowsSettings>
+      <dpiAware 
xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings";>true/pm</dpiAware>
+      <dpiAwareness 
xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings";>PerMonitorV2</dpiAwareness>
     </asmv3:windowsSettings>
   </asmv3:application>
 </assembly>
--
2.45.2.windows.1


-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to