diff --git a/apple/OSX/en.lproj/MainMenu.xib b/apple/OSX/en.lproj/MainMenu.xib index 27a23ed0c7..0479498d6f 100644 --- a/apple/OSX/en.lproj/MainMenu.xib +++ b/apple/OSX/en.lproj/MainMenu.xib @@ -388,11 +388,9 @@ - + 256 {480, 360} - - {{0, 0}, {2560, 1418}} {10000000000000, 10000000000000} @@ -467,8 +465,8 @@ 1 YES - 342884416 - 272630784 + 74448961 + 268436480 _NS:9 diff --git a/apple/RetroArch/main.m b/apple/RetroArch/main.m index c8e84388b8..83944c47e5 100644 --- a/apple/RetroArch/main.m +++ b/apple/RetroArch/main.m @@ -517,6 +517,11 @@ int main(int argc, char *argv[]) for (RAModuleInfo* i in RAModuleInfo.getModules) [cb addItemWithObjectValue:i]; + if (cb.numberOfItems) + [cb selectItemAtIndex:0]; + else + apple_display_alert(@"No libretro cores were found.", @"RetroArch"); + // Run RGUI if needed if (!_wantReload) apple_run_core(nil, 0); @@ -550,7 +555,11 @@ int main(int argc, char *argv[]) if (filenames.count == 1 && filenames[0]) { _file = filenames[0]; - [self chooseCore]; + + if (!_loaded) + _wantReload = true; + else + [self chooseCore]; [sender replyToOpenOrPrint:NSApplicationDelegateReplySuccess]; } @@ -643,6 +652,11 @@ int main(int argc, char *argv[]) apple_frontend_post_event(&event_basic_command, (void*)((NSMenuItem*)sender).tag); } +- (void)alertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo +{ + [NSApplication.sharedApplication stopModal]; +} + @end int main(int argc, char *argv[]) diff --git a/apple/RetroArch/utility.m b/apple/RetroArch/utility.m index 17d5c2aaab..0836e9fdec 100644 --- a/apple/RetroArch/utility.m +++ b/apple/RetroArch/utility.m @@ -35,9 +35,10 @@ void apple_display_alert(NSString* message, NSString* title) alert.informativeText = message; alert.alertStyle = NSInformationalAlertStyle; [alert beginSheetModalForWindow:RetroArch_OSX.get->window - modalDelegate:nil - didEndSelector:nil + modalDelegate:apple_platform + didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) contextInfo:nil]; + [NSApplication.sharedApplication runModalForWindow:alert.window]; #endif }