From 3f0c2a6694e9f2b2ad24c3599c985f4ef192e310 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 3 May 2023 09:47:13 -0700 Subject: [PATCH] Don't set the display scale if DPI scaling isn't enabled In this case we want the display mode pixel to screen coordinates to be 1:1 ... but we lose information about the UI scaling of the display - is that okay? --- src/video/windows/SDL_windowsmodes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/windows/SDL_windowsmodes.c b/src/video/windows/SDL_windowsmodes.c index 6d5ae0faa6..ec2dbc0b14 100644 --- a/src/video/windows/SDL_windowsmodes.c +++ b/src/video/windows/SDL_windowsmodes.c @@ -182,7 +182,7 @@ static SDL_bool WIN_GetDisplayMode(_THIS, HMONITOR hMonitor, LPCWSTR deviceName, mode->pixel_h = data->DeviceMode.dmPelsHeight; mode->refresh_rate = WIN_GetRefreshRate(&data->DeviceMode); - if (index == ENUM_CURRENT_SETTINGS && videodata->GetDpiForMonitor) { + if (index == ENUM_CURRENT_SETTINGS && videodata->GetDpiForMonitor && videodata->dpi_scaling_enabled) { UINT hdpi_uint, vdpi_uint; if (videodata->GetDpiForMonitor(hMonitor, MDT_EFFECTIVE_DPI, &hdpi_uint, &vdpi_uint) == S_OK) { mode->display_scale = hdpi_uint / 96.0f;