Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #4971 #5195

Merged
merged 5 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,20 @@ if(MSVC OR MINGW)
add_custom_target(stkshaders SOURCES ${STK_SHADERS})
endif()

if(MSVC)
SET(CMAKE_SHARED_LINKER_FLAGS /MANIFEST:NO)
add_custom_command(
TARGET supertuxkart POST_BUILD COMMAND "mt.exe"
-manifest \"${PROJECT_SOURCE_DIR}\\windows\\dpi_aware.manifest\"
-inputresource:\"$<TARGET_FILE:supertuxkart>\"\;\#1
-outputresource:\"$<TARGET_FILE:supertuxkart>\"\;\#1)
endif()

if(MINGW)
SET(CMAKE_SHARED_LINKER_FLAGS /MANIFEST:NO)
target_sources(supertuxkart PRIVATE windows/windows_config.rc)
endif()

if(MINGW)
target_link_libraries(supertuxkart -ldxguid -ldnsapi)
if (NOT CMAKE_BUILD_TYPE MATCHES Debug)
Expand Down
13 changes: 13 additions & 0 deletions windows/dpi_aware.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity type="win32" name="MyApplication" version="1.0.0.0" processorArchitecture="amd64"/>

<asmv3:application>
<asmv3:windowsSettings>
<!-- fallback for Windows 7 and 8 -->
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
<!-- adding v1 as fallback would result in v2 not being applied to dialogs on capable systems -->
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2,permonitor</dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
3 changes: 3 additions & 0 deletions windows/windows_config.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "winuser.h"

CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "dpi_aware.manifest"
Loading