src/video/cocoa/SDL_cocoawindow.m
changeset 1973 81255f93dfcd
parent 1962 c92e5f3e68d9
child 2059 4685ccd33d0e
--- a/src/video/cocoa/SDL_cocoawindow.m	Sun Aug 06 07:29:38 2006 +0000
+++ b/src/video/cocoa/SDL_cocoawindow.m	Sun Aug 06 08:55:37 2006 +0000
@@ -262,6 +262,24 @@
 
 @end
 
+@interface SDLWindow : NSWindow
+/* These are needed for borderless/fullscreen windows */
+- (BOOL)canBecomeKeyWindow;
+- (BOOL)canBecomeMainWindow;
+@end
+
+@implementation SDLWindow
+- (BOOL)canBecomeKeyWindow
+{
+    return YES;
+}
+
+- (BOOL)canBecomeMainWindow
+{
+    return YES;
+}
+@end
+
 static int
 SetupWindowData(_THIS, SDL_Window * window, NSWindow *nswindow, SDL_bool created)
 {
@@ -379,7 +397,7 @@
         style |= NSResizableWindowMask;
     }
 
-    nswindow = [[NSWindow alloc] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:FALSE];
+    nswindow = [[SDLWindow alloc] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:FALSE];
 
     [pool release];