From e0a2d152163977fdc2a48ac1bd4144614a1e6f25 Mon Sep 17 00:00:00 2001 From: Akemi Date: Sat, 29 Jul 2017 22:19:34 +0200 Subject: osx: refactor menu bar creation make the menu bar look more like a standard macOS menu bar, with all the standard menu items like About, Help, Open, etc. --- osdep/macosx_application.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'osdep/macosx_application.m') diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m index 7fc1218fee..702292908a 100644 --- a/osdep/macosx_application.m +++ b/osdep/macosx_application.m @@ -66,7 +66,7 @@ static void terminate_cocoa_application(void) - (void)sendEvent:(NSEvent *)event { - if (![_eventsResponder processKeyEvent:event]) + if ([self modalWindow] || ![_eventsResponder processKeyEvent:event]) [super sendEvent:event]; [_eventsResponder wakeup]; } @@ -166,6 +166,11 @@ static void terminate_cocoa_application(void) mpv_shared_app().openCount--; return; } + [self openFiles:filenames]; +} + +- (void)openFiles:(NSArray *)filenames +{ SEL cmpsel = @selector(localizedStandardCompare:); NSArray *files = [filenames sortedArrayUsingSelector:cmpsel]; [_eventsResponder handleFilesArray:files]; -- cgit v1.2.3