Fixed bug #725 SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Sun, 27 Sep 2009 06:20:27 +0000
branchSDL-1.2
changeset 4250 c483b474b1cf
parent 4249 429c8dd3175d
child 4251 ed5e32187eec
Fixed bug #725 Don't let windows reposition the fullscreen window.
src/video/wincommon/SDL_sysevents.c
--- a/src/video/wincommon/SDL_sysevents.c	Sun Sep 27 05:18:43 2009 +0000
+++ b/src/video/wincommon/SDL_sysevents.c	Sun Sep 27 06:20:27 2009 +0000
@@ -588,6 +588,22 @@
 		return(0);
 #endif /* WM_GETMINMAXINFO */
 
+		case WM_WINDOWPOSCHANGING: {
+			WINDOWPOS *windowpos = (WINDOWPOS*)lParam;
+
+			/* When menu is at the side or top, Windows likes
+			   to try to reposition the fullscreen window when
+			   changing video modes.
+			 */
+			if ( !SDL_resizing &&
+			     SDL_PublicSurface &&
+			     (SDL_PublicSurface->flags & SDL_FULLSCREEN) ) {
+				windowpos->x = 0;
+				windowpos->y = 0;
+			}
+		}
+		return(0);
+
 		case WM_WINDOWPOSCHANGED: {
 			SDL_VideoDevice *this = current_video;
 			int w, h;