From 89cf228c305941a16a0a48b9617b6a385296adbc Mon Sep 17 00:00:00 2001 From: Themaister Date: Fri, 12 Oct 2012 21:18:24 +0200 Subject: [PATCH] Use monitor index setting. --- gfx/context/wgl_ctx.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gfx/context/wgl_ctx.c b/gfx/context/wgl_ctx.c index c80869b480..8469bee9d7 100644 --- a/gfx/context/wgl_ctx.c +++ b/gfx/context/wgl_ctx.c @@ -23,12 +23,13 @@ #include #define IDI_ICON 1 +#define MAX_MONITORS 9 static HWND g_hwnd; static HGLRC g_hrc; static HDC g_hdc; static HMONITOR g_last_hm; -static HMONITOR g_all_hms[20]; +static HMONITOR g_all_hms[MAX_MONITORS]; static unsigned g_num_mons; static bool g_quit; @@ -203,7 +204,7 @@ static bool gfx_ctx_init(void) g_restore_desktop = false; g_num_mons = 0; - EnumDisplayMonitors(NULL,NULL,monitor_enum_proc,0); + EnumDisplayMonitors(NULL, NULL, monitor_enum_proc, 0); WNDCLASSEX wndclass = {0}; wndclass.cbSize = sizeof(wndclass); @@ -247,7 +248,6 @@ static bool gfx_ctx_set_video_mode( unsigned bits, bool fullscreen) { (void)bits; - int fs_monitor = 0; DWORD style; MONITORINFOEX current_mon = {{0}}; @@ -256,8 +256,9 @@ static bool gfx_ctx_set_video_mode( g_last_hm = MonitorFromWindow(GetDesktopWindow(), MONITOR_DEFAULTTONEAREST); HMONITOR hm_to_use = g_last_hm; - if(fs_monitor > 0 && fs_monitor <= g_num_mons && g_all_hms[fs_monitor - 1]) - hm_to_use = g_all_hms[fs_monitor - 1]; + unsigned fs_monitor = g_settings.video.monitor_index; + if (fs_monitor && fs_monitor <= g_num_mons && g_all_hms[fs_monitor - 1]) + hm_to_use = g_all_hms[fs_monitor - 1]; GetMonitorInfo(hm_to_use, (MONITORINFO*)¤t_mon);