Merged window position fix from windib code SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Fri, 20 Jul 2007 03:30:41 +0000
branchSDL-1.2
changeset 40867cd5a59480a4
parent 4085 51486c979189
child 4087 4867f7f7dd34
Merged window position fix from windib code
src/video/windx5/SDL_dx5video.c
     1.1 --- a/src/video/windx5/SDL_dx5video.c	Fri Jul 20 03:25:40 2007 +0000
     1.2 +++ b/src/video/windx5/SDL_dx5video.c	Fri Jul 20 03:30:41 2007 +0000
     1.3 @@ -1018,6 +1018,7 @@
     1.4  				int width, int height, int bpp, Uint32 flags)
     1.5  {
     1.6  	SDL_Surface *video;
     1.7 +	int prev_w, prev_h;
     1.8  	HRESULT result;
     1.9  	DWORD sharemode;
    1.10  	DWORD style;
    1.11 @@ -1103,6 +1104,8 @@
    1.12  		}
    1.13  
    1.14  		/* Fill in part of the video surface */
    1.15 +		prev_w = video->w;
    1.16 +		prev_h = video->h;
    1.17  		video->flags = 0;	/* Clear flags */
    1.18  		video->w = width;
    1.19  		video->h = height;
    1.20 @@ -1178,7 +1181,7 @@
    1.21  			const char *window = NULL;
    1.22  			const char *center = NULL;
    1.23  
    1.24 -			if ( !SDL_windowX && !SDL_windowY ) {
    1.25 +			if ( video->w != prev_w || video->h != prev_h ) {
    1.26  				window = SDL_getenv("SDL_VIDEO_WINDOW_POS");
    1.27  				center = SDL_getenv("SDL_VIDEO_CENTERED");
    1.28  				if ( window ) {
    1.29 @@ -1454,6 +1457,8 @@
    1.30  			SDL_OutOfMemory();
    1.31  			return(NULL);
    1.32  		}
    1.33 +		prev_w = video->w;
    1.34 +		prev_h = video->h;
    1.35  		video->w = width;
    1.36  		video->h = height;
    1.37  		video->pitch = 0;
    1.38 @@ -1581,7 +1586,7 @@
    1.39  			const char *window = NULL;
    1.40  			const char *center = NULL;
    1.41  
    1.42 -			if ( !SDL_windowX && !SDL_windowY ) {
    1.43 +			if ( video->w != prev_w || video->h != prev_h ) {
    1.44  				window = SDL_getenv("SDL_VIDEO_WINDOW_POS");
    1.45  				center = SDL_getenv("SDL_VIDEO_CENTERED");
    1.46  				if ( window ) {