[Commits] SDL: Fix up monitor enumeration for Windows 8.1 case.

libsdl.org revision control commits-owner at libsdl.org
Thu Jul 30 10:02:55 PDT 2015


details:   https://hg.libsdl.org/SDL/rev/2361f732e8cb
changeset: 9819:2361f732e8cb
user:      Alfred Reynolds <alfred at valvesoftware.com>
date:      Wed Jul 29 17:19:13 2015 -0700
description:
Fix up monitor enumeration for Windows 8.1 case.

diffstat:

 src/video/windows/SDL_windowsmodes.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r cfeb59daba69 -r 2361f732e8cb src/video/windows/SDL_windowsmodes.c
--- a/src/video/windows/SDL_windowsmodes.c	Wed Jul 29 17:19:11 2015 -0700
+++ b/src/video/windows/SDL_windowsmodes.c	Wed Jul 29 17:19:13 2015 -0700
@@ -121,11 +121,16 @@
 		// so only call after those are set.
 		if (vid_data->GetDpiForMonitor) {
 			WIN_GetMonitorDPIData dpi_data;
+            RECT monitor_rect;
 
 			dpi_data.vid_data = vid_data;
 			dpi_data.mode = mode;
 			dpi_data.mode_data = data;
-			EnumDisplayMonitors(hdc, NULL, WIN_GetMonitorDPI, (LPARAM)&dpi_data);
+            monitor_rect.left = devmode.dmPosition.x;
+            monitor_rect.top = devmode.dmPosition.y;
+            monitor_rect.right = monitor_rect.left + 1;
+            monitor_rect.bottom = monitor_rect.top + 1;
+			EnumDisplayMonitors(NULL, &monitor_rect, WIN_GetMonitorDPI, (LPARAM)&dpi_data);
 		} else {
 			// We don't have the Windows 8.1 routine so just
 			// get system DPI.


More information about the commits mailing list