summaryrefslogtreecommitdiffstats
path: root/osdep/macosx_application.m
diff options
context:
space:
mode:
authorAkemi <der.richter@gmx.de>2017-07-29 22:19:34 +0200
committerAkemi <der.richter@gmx.de>2017-08-18 19:20:41 +0200
commite0a2d152163977fdc2a48ac1bd4144614a1e6f25 (patch)
tree3de2d518ae9916adbe1db497a9f39c0e3fa79905 /osdep/macosx_application.m
parent48ab72b4781b01e334b60d6f5e71afe72900fa58 (diff)
downloadmpv-e0a2d152163977fdc2a48ac1bd4144614a1e6f25.tar.bz2
mpv-e0a2d152163977fdc2a48ac1bd4144614a1e6f25.tar.xz
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.
Diffstat (limited to 'osdep/macosx_application.m')
-rw-r--r--osdep/macosx_application.m7
1 files changed, 6 insertions, 1 deletions
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];