# HG changeset patch # User rubidium # Date 1218654567 0 # Node ID 1816159a6b8ed04781a090380d4d3563d922e9ad # Parent 40b0040c754bb100d90fd2a739ecd79b4008a597 (svn r14071) -Fix [FS#2057]: the screen wouldn't be centered on Windows multimonitor systems if the first monitor is right of the second one. diff -r 40b0040c754b -r 1816159a6b8e src/video/win32_v.cpp --- a/src/video/win32_v.cpp Wed Aug 13 14:52:54 2008 +0000 +++ b/src/video/win32_v.cpp Wed Aug 13 19:09:27 2008 +0000 @@ -18,6 +18,12 @@ #include #include +/** Only MSVC has this header, MinGW supplies the required constants itself */ +#ifdef _MSC_VER +# define COMPILE_MULTIMON_STUBS +# include +#endif /* _MSC_VER */ + static struct { HWND main_wnd; HBITMAP dib_sect; @@ -280,8 +286,8 @@ #endif w = r.right - r.left; h = r.bottom - r.top; - x = (GetSystemMetrics(SM_CXSCREEN) - w) / 2; - y = (GetSystemMetrics(SM_CYSCREEN) - h) / 2; + x = ((GetSystemMetrics(SM_CXVIRTUALSCREEN) - w) / 2) - GetSystemMetrics(SM_XVIRTUALSCREEN); + y = ((GetSystemMetrics(SM_CYVIRTUALSCREEN) - h) / 2) - GetSystemMetrics(SM_YVIRTUALSCREEN); if (_wnd.main_wnd) { ShowWindow(_wnd.main_wnd, SW_SHOWNORMAL); // remove maximize-flag