src/video/cocoa/SDL_cocoawindow.m
changeset 6755 af77e1a6faf0
parent 6681 5a0396a933b5
child 6784 8fd20f04d5d9
--- a/src/video/cocoa/SDL_cocoawindow.m	Fri Dec 14 18:50:07 2012 +0000
+++ b/src/video/cocoa/SDL_cocoawindow.m	Sat Dec 15 00:30:17 2012 +0000
@@ -996,6 +996,23 @@
         cgpoint.y = window->y + y;
         CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint);
     }
+	
+    if ( window->flags & SDL_WINDOW_FULLSCREEN )
+	{
+		SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
+
+		if (window->flags & SDL_WINDOW_INPUT_FOCUS)
+		{
+			/* OpenGL is rendering to the window, so make it visible! */
+			[data->nswindow setLevel:CGShieldingWindowLevel()];
+		} 
+		else 
+		{
+			[data->nswindow setLevel:kCGNormalWindowLevel];
+		}
+		
+	}
+
 }
 
 void