Add DPI Awareness option to configure and bakefile

Add option --with-dpi=[none,system,per-monitor] to configure the dpi awareness
on Windows.

Support DPI Awareness in makefile.gcc and makefile.bcc.

The default DPI awareness is set to per-monitor.
This commit is contained in:
Maarten Bent
2019-10-29 00:33:53 +01:00
parent 6f02c3a897
commit cdf1226573
4 changed files with 47 additions and 0 deletions

View File

@@ -303,6 +303,10 @@
<if cond="FORMAT=='dmars' or FORMAT=='dmars_smake'">_WIN32_WINNT=0x0400</if>
</set>
<set var="WIN32_DPI_MANIFEST">
<if cond="PLATFORM_WIN32=='1' and IS_MSVC=='0'">wxUSE_DPI_AWARE_MANIFEST=$(USE_DPI_AWARE_MANIFEST)</if>
</set>
<set var="CAIRO_LIB">
<if cond="USE_CAIRO=='1'">cairo</if>
</set>
@@ -343,6 +347,7 @@
</if>
<define>$(NO_VC_CRTDBG)</define>
<define>$(WIN32_WINNT)</define>
<res-define>$(WIN32_DPI_MANIFEST)</res-define>
<if cond="FORMAT=='msvc'">
<ldflags>$(LINK_TARGET_CPU)</ldflags>
</if>

View File

@@ -327,6 +327,14 @@ Default is to use debug CRT if and only if BUILD==debug.
</description>
</option>
<option name="USE_DPI_AWARE_MANIFEST">
<values>0,1,2</values>
<default-value>2</default-value>
<description>
Set DPI Awareness (win32) to none, system or per-monitor.
</description>
</option>
<option name="USE_THREADS">
<values>0,1</values>
<default-value>1</default-value>

19
configure vendored
View File

@@ -883,6 +883,7 @@ INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
RANLIB
USE_DPI_AWARE_MANIFEST
HOST_SUFFIX
HEADER_PAD_OPTION
SAMPLES_CXXFLAGS
@@ -1058,6 +1059,7 @@ enable_official_build
enable_vendor
enable_all_features
enable_sys_libs
with_dpi
enable_universal
with_themes
with_gtk
@@ -2312,6 +2314,7 @@ Optional Packages:
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--without-subdirs don't generate makefiles for samples/demos/...
--with-flavour=NAME specify a name to identify this build
--with-dpi=none|system|per-monitor use dpi-awareness (Win32 only)
--with-themes=all|list use only the specified comma-separated list of wxUniversal themes
--with-gtk[=VERSION] use GTK+, VERSION can be 4 (EXPERIMENTAL), 3, 2 (default), 1 or "any"
--with-motif use Motif/Lesstif
@@ -4306,6 +4309,13 @@ if test "$wxUSE_ALL_FEATURES" = "no"; then
fi
# Check whether --with-dpi was given.
if test "${with_dpi+set}" = set; then :
withval=$with_dpi; wxWITH_DPI_MANIFEST="$withval"
fi
if test "$wxUSE_GUI" = "yes"; then
@@ -18402,6 +18412,14 @@ $as_echo "#define HAVE_CXX17 1" >>confdefs.h
fi
fi
USE_DPI_AWARE_MANIFEST=0
if test "$wxWITH_DPI_MANIFEST" = "system" ; then
USE_DPI_AWARE_MANIFEST=1
fi
if test "$wxWITH_DPI_MANIFEST" = "per-monitor" ; then
USE_DPI_AWARE_MANIFEST=2
fi
if test "x$SUNCXX" != xyes; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
@@ -37820,6 +37838,7 @@ TOOLKIT_LOWERCASE=`echo $TOOLKIT | tr '[A-Z]' '[a-z]'`
case "$TOOLKIT" in
GTK)
TOOLKIT_DESC="GTK+"

View File

@@ -408,6 +408,8 @@ if test "$wxUSE_ALL_FEATURES" = "no"; then
DEFAULT_wxUSE_MEDIACTRL=no
fi
AC_ARG_WITH(dpi, [ --with-dpi=none|system|per-monitor set dpi-awareness (Win32 only), default is per-monitor], [wxWITH_DPI_MANIFEST="$withval"])
dnl ---------------------------------------------------------------------------
dnl port selection
dnl ---------------------------------------------------------------------------
@@ -1124,6 +1126,18 @@ if test -n "$wxWITH_CXX"; then
fi
fi
case "$wxWITH_DPI_MANIFEST" in
none)
USE_DPI_AWARE_MANIFEST=0 ;;
system)
USE_DPI_AWARE_MANIFEST=1 ;;
per-monitor)
USE_DPI_AWARE_MANIFEST=2 ;;
*)
USE_DPI_AWARE_MANIFEST=0
AC_MSG_WARN([Unsupported DPI awareness value "$wxWITH_DPI_MANIFEST" ignored.])
esac
dnl ar command
dnl defines AR with the appropriate command
dnl
@@ -8095,6 +8109,7 @@ AC_SUBST(SAMPLES_RPATH_FLAG)
AC_SUBST(SAMPLES_CXXFLAGS)
AC_SUBST(HEADER_PAD_OPTION)
AC_SUBST(HOST_SUFFIX)
AC_SUBST(USE_DPI_AWARE_MANIFEST)
case "$TOOLKIT" in
GTK)