Resize window to fit asked video mode
authorPatrice Mandin <patmandin@gmail.com>
Thu, 02 Jun 2005 22:02:18 +0000
changeset 1066 671bbd773c8a
parent 1065 5d9947da7510
child 1067 f73b199bcd75
Resize window to fit asked video mode
src/video/gem/SDL_gemvideo.c
--- a/src/video/gem/SDL_gemvideo.c	Thu Jun 02 22:00:48 2005 +0000
+++ b/src/video/gem/SDL_gemvideo.c	Thu Jun 02 22:02:18 2005 +0000
@@ -701,6 +701,19 @@
 
 			/* Open the window */
 			wind_open(GEM_handle,x2,y2,w2,h2);
+		} else {
+			/* Resize window if needed, to fit asked video mode */
+			if (modeflags & SDL_RESIZABLE) {
+				wind_get (GEM_handle, WF_WORKXYWH, &x2,&y2,&w2,&h2);
+				if ((w2&15)!=0) {
+					w2=(w2|15)+1;
+				}
+				if ((w2!=width) || (h2!=height)) {
+					if (wind_calc(WC_BORDER, GEM_win_type, x2,y2,width,height, &x2,&y2,&w2,&h2)) {
+						wind_set (GEM_handle, WF_CURRXYWH, x2,y2,w2,h2);
+					}
+				}
+			}
 		}
 
 		GEM_fullscreen = SDL_FALSE;