summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/mac/mamefswindow.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/mac/mamefswindow.mm')
-rw-r--r--src/osd/mac/mamefswindow.mm41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/osd/mac/mamefswindow.mm b/src/osd/mac/mamefswindow.mm
new file mode 100644
index 00000000000..1fcbdcd02c3
--- /dev/null
+++ b/src/osd/mac/mamefswindow.mm
@@ -0,0 +1,41 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont
+//============================================================
+//
+// mamewfsindow.mm - our fullscreen window, subclassed from NSWindow
+//
+// Mac OSD by R. Belmont
+//
+//============================================================
+
+#import "mamefswindow.h"
+
+@implementation MAMEFSWindow
+
+-(instancetype)init
+{
+ NSRect screenRect = [[NSScreen mainScreen] frame];
+ self = [super initWithContentRect:screenRect
+ styleMask:NSBorderlessWindowMask
+ backing:NSBackingStoreBuffered
+ defer:YES];
+
+ // Set the window level to be above the menu bar
+ [self setLevel:NSMainMenuWindowLevel+1];
+ [self setOpaque:YES];
+ [self setHidesOnDeactivate:YES];
+
+ return self;
+}
+
+-(BOOL)canBecomeKeyWindow
+{
+ return YES;
+}
+
+- (void)keyDown:(NSEvent *)event
+{
+ [[self windowController] keyDown:event];
+}
+
+@end