diff src/video/windib/SDL_dibvideo.c @ 1290:c4a5a772c5d9

The event code was fine, and calculated the SDL_windowX/Y correctly. What we really needed to do was avoid doing client rect adjustment on zoomed windows. :)
author Sam Lantinga <slouken@libsdl.org>
date Sun, 29 Jan 2006 18:17:35 +0000
parents ea3888b472bf
children 31331c444ea2
line wrap: on
line diff
--- a/src/video/windib/SDL_dibvideo.c	Sun Jan 29 09:19:55 2006 +0000
+++ b/src/video/windib/SDL_dibvideo.c	Sun Jan 29 18:17:35 2006 +0000
@@ -665,13 +665,15 @@
 	}
 
 	/* Resize the window */
-	if ( !SDL_windowid ) {
+	if ( !SDL_windowid && !IsZoomed(SDL_Window) ) {
 		HWND top;
 		UINT swp_flags;
-		const char *window = getenv("SDL_VIDEO_WINDOW_POS");
-		const char *center = getenv("SDL_VIDEO_CENTERED");
+		const char *window = NULL;
+		const char *center = NULL;
 
 		if ( !SDL_windowX && !SDL_windowY ) {
+			window = getenv("SDL_VIDEO_WINDOW_POS");
+			center = getenv("SDL_VIDEO_CENTERED");
 			if ( window ) {
 				if ( sscanf(window, "%d,%d", &x, &y) == 2 ) {
 					SDL_windowX = x;
@@ -679,7 +681,6 @@
 				}
 				if ( strcmp(window, "center") == 0 ) {
 					center = window;
-					window = NULL;
 				}
 			}
 		}
@@ -706,9 +707,6 @@
 			x = y = -1;
 			swp_flags |= SWP_NOMOVE;
 		}
-		if ( y < 0 ) { /* Cover up title bar for more client area */
-			y -= GetSystemMetrics(SM_CYCAPTION)/2;
-		}
 		if ( flags & SDL_FULLSCREEN ) {
 			top = HWND_TOPMOST;
 		} else {