From 1b2ef664162a4b9e684c8847e80db4269e97beec Mon Sep 17 00:00:00 2001 From: glx Date: Mon, 14 Feb 2011 20:16:36 +0000 Subject: (svn r22081) -Fix [FS#4489]: if fullscreen fails with current resolution, use desktop resolution --- src/video/win32_v.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index 1230eeea2..dc230456d 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -255,6 +255,13 @@ static bool MakeWindow(bool full_screen) settings.dmPelsHeight = _wnd.height_org; settings.dmDisplayFrequency = _display_hz; + /* Test fullscreen with current resolution, if it fails use desktop resolution. */ + if (ChangeDisplaySettings(&settings, CDS_FULLSCREEN | CDS_TEST) != DISP_CHANGE_SUCCESSFUL) { + RECT r; + GetWindowRect(GetDesktopWindow(), &r); + return _video_driver->ChangeResolution(r.right - r.left, r.bottom - r.top); + } + if (ChangeDisplaySettings(&settings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) { MakeWindow(false); // don't care about the result return false; // the request failed -- cgit v1.2.3-70-g09d2