diff --git a/client/DPIaware.manifest b/client/DPIaware.manifest deleted file mode 100644 index bfb1c7586..000000000 --- a/client/DPIaware.manifest +++ /dev/null @@ -1,9 +0,0 @@ - - - - - true - - - diff --git a/client/renderSDL/WindowHandler.cpp b/client/renderSDL/WindowHandler.cpp index 8d31a1da6..427cce029 100644 --- a/client/renderSDL/WindowHandler.cpp +++ b/client/renderSDL/WindowHandler.cpp @@ -114,6 +114,14 @@ EWindowMode WindowHandler::getPreferredWindowMode() const WindowHandler::WindowHandler() { +#ifdef VCMI_WINDOWS + // set VCMI as "per-monitor DPI awareness". This completely disables any DPI-scaling by system. + // Might not be the best solution since VCMI can't automatically adjust to DPI changes (including moving to monitors with different DPI scaling) + // However this fixed unintuitive bug where player selects specific resolution for windowed mode, but ends up with completely different one due to scaling + // NOTE: requires SDL 2.24. + SDL_SetHint(SDL_HINT_WINDOWS_DPI_AWARENESS, "permonitor"); +#endif + if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE)) { logGlobal->error("Something was wrong: %s", SDL_GetError());