Fixed mouse grab going fullscreen to windowed in Windows
authorSam Lantinga <slouken@libsdl.org>
Mon, 19 Aug 2002 02:34:22 +0000
changeset 447 16d0449891b8
parent 446 92328a8635fe
child 448 323c766f5a46
Fixed mouse grab going fullscreen to windowed in Windows
src/video/wincommon/SDL_sysevents.c
--- a/src/video/wincommon/SDL_sysevents.c	Sun Aug 18 19:22:42 2002 +0000
+++ b/src/video/wincommon/SDL_sysevents.c	Mon Aug 19 02:34:22 2002 +0000
@@ -438,22 +438,21 @@
 		return(0);
 #endif /* WM_GETMINMAXINFO */
 
-		case WM_MOVE: {
+		case WM_WINDOWPOSCHANGED: {
 			SDL_VideoDevice *this = current_video;
+			int w, h;
 
 			GetClientRect(SDL_Window, &SDL_bounds);
 			ClientToScreen(SDL_Window, (LPPOINT)&SDL_bounds);
 			ClientToScreen(SDL_Window, (LPPOINT)&SDL_bounds+1);
+			w = SDL_bounds.right-SDL_bounds.left;
+			h = SDL_bounds.bottom-SDL_bounds.top;
 			if ( this->input_grab != SDL_GRAB_OFF ) {
 				ClipCursor(&SDL_bounds);
 			}
-		}
-		break;
-	
-		case WM_SIZE: {
-			if ( SDL_PublicSurface &&
+			if ( SDL_PublicSurface && 
 				(SDL_PublicSurface->flags & SDL_RESIZABLE) ) {
-				SDL_PrivateResize(LOWORD(lParam), HIWORD(lParam));
+				SDL_PrivateResize(w, h);
 			}
 			return(0);
 		}