From c5ad973795da3c0294b0fd949e1d3d3d423e298c Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Sun, 5 Jan 2020 16:48:41 +0000 Subject: [PATCH] Disable scaling by the OS on windows (scale != 100%). Could not get this working through the manifest, but this seems to work as well. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4303 --- src/gui/sdlmain.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index 34ca3f57..5e343d56 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -99,6 +99,7 @@ extern char** environ; #define WIN32_LEAN_AND_MEAN #endif #include +#include #if C_DDRAW #include struct private_hwdata { @@ -1978,10 +1979,22 @@ static void erasemapperfile() { exit(0); } +void Disable_OS_Scaling() { +#if defined (WIN32) + typedef BOOL (*function_set_dpi_pointer)(); + function_set_dpi_pointer function_set_dpi; + function_set_dpi = (function_set_dpi_pointer) GetProcAddress(LoadLibrary("user32.dll"), "SetProcessDPIAware"); + if (function_set_dpi) { + function_set_dpi(); + } +#endif +} //extern void UI_Init(void); int main(int argc, char* argv[]) { try { + Disable_OS_Scaling(); //Do this early on, maybe override it through some parameter. + CommandLine com_line(argc,argv); Config myconf(&com_line); control=&myconf;