From d69ddb8656e83290f00a61c9acac23dd8f43738f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 25 Aug 2023 00:03:47 +0200 Subject: [PATCH] Revert all recent wxUSE_DPI_AWARE_MANIFEST-related changes This reverts 5d630caabd (Make it enough to predefine only wxUSE_DPI_AWARE_MANIFEST, 2023-08-23) and all the commits which tried to fix the breakage caused by it. While the original change had merit, it seems to be too difficult to fix all our build systems to avoid embedding manifest when defining this in the code, like samples/sample.rc does, so revert this change for now. Maybe it can be reintroduced in the future after switching to some other build system. --- build/cmake/functions.cmake | 7 ++--- docs/doxygen/mainpages/const_wxusedef.h | 5 ++- include/wx/msw/wx.rc | 10 +----- samples/minimal/CMakeLists.txt | 7 ++--- samples/minimal/minimal.vcxproj | 40 +++++++++++++---------- tests/test.vcxproj | 42 +++++++++++++++---------- tests/test_gui.vcxproj | 42 +++++++++++++++---------- 7 files changed, 81 insertions(+), 72 deletions(-) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index b7d5a9af6b..a74e8b64b2 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -793,19 +793,16 @@ function(wx_add name group) set(wxUSE_DPI_AWARE_MANIFEST_VALUE 0) if (${wxUSE_DPI_AWARE_MANIFEST} MATCHES "system") set(wxUSE_DPI_AWARE_MANIFEST_VALUE 1) + list(APPEND src_files "${wxSOURCE_DIR}/include/wx/msw/wx_dpi_aware.manifest") elseif(${wxUSE_DPI_AWARE_MANIFEST} MATCHES "per-monitor") set(wxUSE_DPI_AWARE_MANIFEST_VALUE 2) + list(APPEND src_files "${wxSOURCE_DIR}/include/wx/msw/wx_dpi_aware_pmv2.manifest") endif() endif() add_executable(${target_name} ${exe_type} ${src_files}) if (DEFINED wxUSE_DPI_AWARE_MANIFEST_VALUE) - if(MSVC) - # Manifest is included via .rc file. - # Disable the default manifest added by CMake to prevent dupicate manifest error. - set_target_properties(${target_name} PROPERTIES LINK_FLAGS "/MANIFEST:NO") - endif() target_compile_definitions(${target_name} PRIVATE wxUSE_DPI_AWARE_MANIFEST=${wxUSE_DPI_AWARE_MANIFEST_VALUE}) endif() endif() diff --git a/docs/doxygen/mainpages/const_wxusedef.h b/docs/doxygen/mainpages/const_wxusedef.h index e2feb94898..7749423c4b 100644 --- a/docs/doxygen/mainpages/const_wxusedef.h +++ b/docs/doxygen/mainpages/const_wxusedef.h @@ -314,8 +314,7 @@ library: @itemdef{wxUSE_DC_CACHEING, cache temporary wxDC objects.} @itemdef{wxUSE_DDE_FOR_IPC, See wx/ipc.h file.} @itemdef{wxUSE_DPI_AWARE_MANIFEST, Set the DPI awareness of the application -(0=none, 1=system, 2=per-monitor). Used by CMake and can be predefined before -including @c wx/msw/wx.rc.} +(0=none, 1=system, 2=per-monitor). Used by CMake and when wxUSE_RC_MANIFEST is enabled.} @itemdef{wxUSE_ENH_METAFILE, Use wxEnhMetaFile.} @itemdef{wxUSE_HOTKEY, Use wxWindow::RegisterHotKey() and wxWindow::UnregisterHotKey} @itemdef{wxUSE_INKEDIT, Use InkEdit library. Related to Tablet PCs.} @@ -328,7 +327,7 @@ manifest from wxWidgets RC file. See also wxUSE_RC_MANIFEST.} @itemdef{wxUSE_PS_PRINTING, See src/msw/dcprint.cpp file.} @itemdef{wxUSE_RC_MANIFEST, Include manifest for common controls library v6 from wxWidgets RC file. This is disabled by default for MSVC but enabled for -the other compilers. See also wxUSE_NO_MANIFEST and wxUSE_DPI_AWARE_MANIFEST.} +the other compilers. See also wxUSE_NO_MANIFEST.} @itemdef{wxUSE_REGKEY, Use wxRegKey class.} @itemdef{wxUSE_RICHEDIT, Enable use of riched32.dll in wxTextCtrl} @itemdef{wxUSE_RICHEDIT2, Enable use of riched20.dll in wxTextCtrl} diff --git a/include/wx/msw/wx.rc b/include/wx/msw/wx.rc index a23300f52b..cae328fd31 100644 --- a/include/wx/msw/wx.rc +++ b/include/wx/msw/wx.rc @@ -91,19 +91,11 @@ wxBITMAP_STD_COLOURS BITMAP "wx/msw/colours.bmp" // Include manifest file for common controls library v6 required to use themes. // // Predefining wxUSE_NO_MANIFEST as 1 always disables the use of the manifest. -// Otherwise we include it either if wxUSE_RC_MANIFEST is defined as 1 or if -// wxUSE_DPI_AWARE_MANIFEST is defined. +// Otherwise we include it only if wxUSE_RC_MANIFEST is defined as 1. // #if !defined(wxUSE_NO_MANIFEST) || (wxUSE_NO_MANIFEST == 0) -#ifdef wxUSE_DPI_AWARE_MANIFEST - // Defining wxUSE_DPI_AWARE_MANIFEST overrides wxUSE_RC_MANIFEST, as it - // makes no sense to define the former just for it to be ignored. - #undef wxUSE_RC_MANIFEST - #define wxUSE_RC_MANIFEST 1 -#endif - #if defined(wxUSE_RC_MANIFEST) && wxUSE_RC_MANIFEST // see "about isolated applications" topic in MSDN diff --git a/samples/minimal/CMakeLists.txt b/samples/minimal/CMakeLists.txt index 81abbe9668..a68272f763 100644 --- a/samples/minimal/CMakeLists.txt +++ b/samples/minimal/CMakeLists.txt @@ -46,7 +46,7 @@ set(SRC_FILES ) if(WIN32) - # Include a RC file for windows, for icon and manifest + # Include a RC file for windows list(APPEND SRC_FILES ../sample.rc) elseif(APPLE) # Add an icon for the apple .app file @@ -58,10 +58,7 @@ add_executable(${PROJECT_NAME} WIN32 MACOSX_BUNDLE ${SRC_FILES}) # Link required libraries to the executable target_link_libraries(${PROJECT_NAME} ${wxWidgets_LIBRARIES}) -if(MSVC) - # Prevent duplicate manifest, it is already added via sample.rc - set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/MANIFEST:NO") -elseif(APPLE) +if(APPLE) set_target_properties(${PROJECT_NAME} PROPERTIES RESOURCE "../../src/osx/carbon/wxmac.icns" MACOSX_BUNDLE_ICON_FILE wxmac.icns diff --git a/samples/minimal/minimal.vcxproj b/samples/minimal/minimal.vcxproj index c4c7631036..ad54c45467 100644 --- a/samples/minimal/minimal.vcxproj +++ b/samples/minimal/minimal.vcxproj @@ -103,35 +103,27 @@ true - false false - false true - false false - false true - false false - false true - false false - false @@ -168,7 +160,9 @@ true - + + ./../../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -205,7 +199,9 @@ true - + + ./../../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -242,7 +238,9 @@ true - + + ./../../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -279,7 +277,9 @@ true - + + ./../../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -316,7 +316,9 @@ true - + + ./../../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -353,7 +355,9 @@ true - + + ./../../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -390,7 +394,9 @@ true - + + ./../../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -427,7 +433,9 @@ true - + + ./../../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + diff --git a/tests/test.vcxproj b/tests/test.vcxproj index 94dd5e8aab..866fc360a4 100644 --- a/tests/test.vcxproj +++ b/tests/test.vcxproj @@ -104,35 +104,27 @@ true - false false - false true - false false - false true - false false - false true - false false - false @@ -173,7 +165,9 @@ true - + + ./../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -214,7 +208,9 @@ true - + + ./../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -255,7 +251,9 @@ true - + + ./../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -296,7 +294,9 @@ true - + + ./../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -337,7 +337,9 @@ true - + + ./../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -378,7 +380,9 @@ true - + + ./../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -419,7 +423,9 @@ true - + + ./../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -460,7 +466,9 @@ true - + + ./../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -563,4 +571,4 @@ - \ No newline at end of file + diff --git a/tests/test_gui.vcxproj b/tests/test_gui.vcxproj index fef43f7219..56591e69a2 100644 --- a/tests/test_gui.vcxproj +++ b/tests/test_gui.vcxproj @@ -103,35 +103,27 @@ true - false false - false true - false false - false true - false false - false true - false false - false @@ -172,7 +164,9 @@ true - + + ./../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -213,7 +207,9 @@ true - + + ./../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -254,7 +250,9 @@ true - + + ./../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -295,7 +293,9 @@ true - + + ./../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -336,7 +336,9 @@ true - + + ./../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -377,7 +379,9 @@ true - + + ./../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -418,7 +422,9 @@ true - + + ./../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -459,7 +465,9 @@ true - + + ./../include/wx/msw/wx_dpi_aware_pmv2.manifest %(AdditionalManifestFiles) + @@ -582,4 +590,4 @@ - \ No newline at end of file +