diff src/video/windib/SDL_dibvideo.c @ 448:323c766f5a46

Fullscreen windows are always topmost under Windows
author Sam Lantinga <slouken@libsdl.org>
date Mon, 19 Aug 2002 03:09:25 +0000
parents b37ce4813ad4
children a6fa62b1be09
line wrap: on
line diff
--- a/src/video/windib/SDL_dibvideo.c	Mon Aug 19 02:34:22 2002 +0000
+++ b/src/video/windib/SDL_dibvideo.c	Mon Aug 19 03:09:25 2002 +0000
@@ -573,9 +573,9 @@
 #endif
 	}
 
-   /* DJM: Don't piss of anyone who has setup his own window */
-   if (!SDL_windowid)
-	   SetWindowLong(SDL_Window, GWL_STYLE, style);
+	/* DJM: Don't piss of anyone who has setup his own window */
+	if (!SDL_windowid)
+		SetWindowLong(SDL_Window, GWL_STYLE, style);
 
 	/* Delete the old bitmap if necessary */
 	if ( screen_bmp != NULL ) {
@@ -651,6 +651,7 @@
 
 	/* Resize the window */
 	if ( SDL_windowid == NULL ) {
+		HWND top;
 		UINT swp_flags;
 
 		SDL_resizing = 1;
@@ -671,14 +672,19 @@
 			y -= GetSystemMetrics(SM_CYCAPTION)/2;
 		}
 #ifndef _WIN32_WCE
-		swp_flags = (SWP_NOCOPYBITS | SWP_NOZORDER | SWP_SHOWWINDOW);
+		swp_flags = (SWP_NOCOPYBITS | SWP_FRAMECHANGED | SWP_SHOWWINDOW);
 #else
-		swp_flags = (SWP_NOZORDER | SWP_SHOWWINDOW);
+		swp_flags = (SWP_FRAMECHANGED | SWP_SHOWWINDOW);
 #endif
 		if ( was_visible && !(flags & SDL_FULLSCREEN) ) {
 			swp_flags |= SWP_NOMOVE;
 		}
-		SetWindowPos(SDL_Window, NULL, x, y, width, height, swp_flags);
+		if ( flags & SDL_FULLSCREEN ) {
+			top = HWND_TOPMOST;
+		} else {
+			top = HWND_NOTOPMOST;
+		}
+		SetWindowPos(SDL_Window, top, x, y, width, height, swp_flags);
 		SDL_resizing = 0;
 		SetForegroundWindow(SDL_Window);
 	}