Fix up monitor enumeration for Windows 8.1 case.
authorAlfred Reynolds <alfred@valvesoftware.com>
Wed, 29 Jul 2015 17:19:13 -0700
changeset 98192361f732e8cb
parent 9818 cfeb59daba69
child 9820 c0bcc39a3491
Fix up monitor enumeration for Windows 8.1 case.
src/video/windows/SDL_windowsmodes.c
     1.1 --- a/src/video/windows/SDL_windowsmodes.c	Wed Jul 29 17:19:11 2015 -0700
     1.2 +++ b/src/video/windows/SDL_windowsmodes.c	Wed Jul 29 17:19:13 2015 -0700
     1.3 @@ -121,11 +121,16 @@
     1.4  		// so only call after those are set.
     1.5  		if (vid_data->GetDpiForMonitor) {
     1.6  			WIN_GetMonitorDPIData dpi_data;
     1.7 +            RECT monitor_rect;
     1.8  
     1.9  			dpi_data.vid_data = vid_data;
    1.10  			dpi_data.mode = mode;
    1.11  			dpi_data.mode_data = data;
    1.12 -			EnumDisplayMonitors(hdc, NULL, WIN_GetMonitorDPI, (LPARAM)&dpi_data);
    1.13 +            monitor_rect.left = devmode.dmPosition.x;
    1.14 +            monitor_rect.top = devmode.dmPosition.y;
    1.15 +            monitor_rect.right = monitor_rect.left + 1;
    1.16 +            monitor_rect.bottom = monitor_rect.top + 1;
    1.17 +			EnumDisplayMonitors(NULL, &monitor_rect, WIN_GetMonitorDPI, (LPARAM)&dpi_data);
    1.18  		} else {
    1.19  			// We don't have the Windows 8.1 routine so just
    1.20  			// get system DPI.