src/video/windows/SDL_windowsmodes.c
changeset 9819 2361f732e8cb
parent 9813 0652406e46c6
child 9889 7cb2c3ec8205
equal deleted inserted replaced
9818:cfeb59daba69 9819:2361f732e8cb
   119 
   119 
   120 		// WIN_GetMonitorDPI needs mode->w and mode->h
   120 		// WIN_GetMonitorDPI needs mode->w and mode->h
   121 		// so only call after those are set.
   121 		// so only call after those are set.
   122 		if (vid_data->GetDpiForMonitor) {
   122 		if (vid_data->GetDpiForMonitor) {
   123 			WIN_GetMonitorDPIData dpi_data;
   123 			WIN_GetMonitorDPIData dpi_data;
       
   124             RECT monitor_rect;
   124 
   125 
   125 			dpi_data.vid_data = vid_data;
   126 			dpi_data.vid_data = vid_data;
   126 			dpi_data.mode = mode;
   127 			dpi_data.mode = mode;
   127 			dpi_data.mode_data = data;
   128 			dpi_data.mode_data = data;
   128 			EnumDisplayMonitors(hdc, NULL, WIN_GetMonitorDPI, (LPARAM)&dpi_data);
   129             monitor_rect.left = devmode.dmPosition.x;
       
   130             monitor_rect.top = devmode.dmPosition.y;
       
   131             monitor_rect.right = monitor_rect.left + 1;
       
   132             monitor_rect.bottom = monitor_rect.top + 1;
       
   133 			EnumDisplayMonitors(NULL, &monitor_rect, WIN_GetMonitorDPI, (LPARAM)&dpi_data);
   129 		} else {
   134 		} else {
   130 			// We don't have the Windows 8.1 routine so just
   135 			// We don't have the Windows 8.1 routine so just
   131 			// get system DPI.
   136 			// get system DPI.
   132 			data->HorzDPI = (float)GetDeviceCaps( hdc, LOGPIXELSX );
   137 			data->HorzDPI = (float)GetDeviceCaps( hdc, LOGPIXELSX );
   133 			data->VertDPI = (float)GetDeviceCaps( hdc, LOGPIXELSY );
   138 			data->VertDPI = (float)GetDeviceCaps( hdc, LOGPIXELSY );