changeset 19300:011957777513 draft

(svn r24189) -Fix: when going to fullscreen and back, restore to the resolution you were, not to the fullscreen resolution (Windows only)
author truebrain <truebrain@openttd.org>
date Mon, 30 Apr 2012 16:49:26 +0000
parents de513b9b5afe
children ed3150717dc1
files src/video/win32_v.cpp
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -296,6 +296,9 @@
 	} else if (_wnd.fullscreen) {
 		/* restore display? */
 		ChangeDisplaySettings(NULL, 0);
+		/* restore the resolution */
+		_wnd.width = _bck_resolution.width;
+		_wnd.height = _bck_resolution.height;
 	}
 #endif
 
@@ -628,7 +631,7 @@
 				/* Set maximized flag when we maximize (obviously), but also when we
 				 * switched to fullscreen from a maximized state */
 				_window_maximize = (wParam == SIZE_MAXIMIZED || (_window_maximize && _fullscreen));
-				if (_window_maximize) _bck_resolution = _cur_resolution;
+				if (_window_maximize || _fullscreen) _bck_resolution = _cur_resolution;
 				ClientSizeChanged(LOWORD(lParam), HIWORD(lParam));
 			}
 			return 0;