summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd
diff options
context:
space:
mode:
authorGravatarGravatar arbee <rb6502@users.noreply.github.com>2019-09-16 22:12:14 -0400
committerGravatarGravatar arbee <rb6502@users.noreply.github.com>2019-09-16 22:12:14 -0400
commit406655a9fcd512a4ffd1514b2ea777b1fb5a3d52 (patch)
treede04eceebc7994abdaee5df575f9c6aa0642e144 /src/osd
parent87a793c97dac7101b3e79dfd211458859b636e94 (diff)
OSD_MAC: window now visible and has a title, but doesn't render (nw)
Diffstat (limited to 'src/osd')
-rw-r--r--src/osd/mac/windowcontroller.mm24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/osd/mac/windowcontroller.mm b/src/osd/mac/windowcontroller.mm
index 396fbc49238..aa09e96b0d5 100644
--- a/src/osd/mac/windowcontroller.mm
+++ b/src/osd/mac/windowcontroller.mm
@@ -102,20 +102,30 @@ void *CreateMAMEWindow(char *title, int x, int y, int w, int h, bool isFullscree
NSWindow *window = [NSWindow alloc];
MAMEWindowController *controller = [MAMEWindowController alloc];
+ /* To avoid event handling issues like SDL has, we run MAME in
+ a separate NSThread. This means all UI calls from MAME
+ must be delegated over to the main thread because the
+ Cocoa UI stuff is not thread-safe */
dispatch_sync(dispatch_get_main_queue(), ^{
[window initWithContentRect:bounds
styleMask:style
backing:NSBackingStoreBuffered
defer:NO];
[controller initWithWindow:window];
- });
- if (isFullscreen)
- {
- [controller goFullscreen];
- }
-
- [window makeKeyAndOrderFront:nil];
+ NSString *nstitle = [[NSString alloc] initWithUTF8String:title];
+ [window setTitle:nstitle];
+ [nstitle release];
+
+ if (isFullscreen)
+ {
+ [controller goFullscreen];
+ }
+ else
+ {
+ [window makeKeyAndOrderFront:nil];
+ }
+ });
return (void *)controller;
}