src/video/cocoa/SDL_cocoawindow.m
changeset 6784 8fd20f04d5d9
parent 6755 af77e1a6faf0
child 6788 036f53f2f5aa
--- a/src/video/cocoa/SDL_cocoawindow.m	Mon Dec 31 10:13:25 2012 -0800
+++ b/src/video/cocoa/SDL_cocoawindow.m	Mon Dec 31 10:14:38 2012 -0800
@@ -915,7 +915,7 @@
     }
 
 #ifdef FULLSCREEN_TOGGLEABLE
-    if (fullscreen) {
+    if (SDL_ShouldAllowTopmost() && fullscreen) {
         /* OpenGL is rendering to the window, so make it visible! */
         [nswindow setLevel:CGShieldingWindowLevel()];
     } else {
@@ -997,22 +997,16 @@
         CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint);
     }
 	
-    if ( window->flags & SDL_WINDOW_FULLSCREEN )
-	{
+    if ( window->flags & SDL_WINDOW_FULLSCREEN ) {
 		SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
 
-		if (window->flags & SDL_WINDOW_INPUT_FOCUS)
-		{
+		if (SDL_ShouldAllowTopmost() && (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
 			/* OpenGL is rendering to the window, so make it visible! */
 			[data->nswindow setLevel:CGShieldingWindowLevel()];
-		} 
-		else 
-		{
+		} else {
 			[data->nswindow setLevel:kCGNormalWindowLevel];
 		}
-		
 	}
-
 }
 
 void