# HG changeset patch # User reimar # Date 1347563737 0 # Node ID 5a9728bbb51eec75c0c4f7ae0145c43a848e0751 # Parent 3be1bcf3f16be7d86fa1432b0a382989da819efd Move some code around in preparation for following patch. diff -r 3be1bcf3f16b -r 5a9728bbb51e libvo/vo_corevideo.m --- a/libvo/vo_corevideo.m Thu Sep 13 19:11:55 2012 +0000 +++ b/libvo/vo_corevideo.m Thu Sep 13 19:15:37 2012 +0000 @@ -405,27 +405,11 @@ if(!shared_buffer) { - NSApplicationLoad(); - NSApp = [NSApplication sharedApplication]; - isLeopardOrLater = floor(NSAppKitVersionNumber) > 824; - - osx_foreground_hack(); - if(!mpGLView) { mpGLView = [[MPlayerOpenGLView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) pixelFormat:[MPlayerOpenGLView defaultPixelFormat]]; [mpGLView autorelease]; } - // Install an event handler so the Quit menu entry works - // The proper way using NSApp setDelegate: and - // applicationShouldTerminate: does not work, - // probably NSApplication never installs its handler. - [[NSAppleEventManager sharedAppleEventManager] - setEventHandler:mpGLView - andSelector:@selector(handleQuitEvent:withReplyEvent:) - forEventClass:kCoreEventClass - andEventID:kAEQuitApplication]; - [mpGLView display]; [mpGLView preinit]; } @@ -463,6 +447,22 @@ GLint swapInterval = 1; CVReturn error; + NSApplicationLoad(); + NSApp = [NSApplication sharedApplication]; + isLeopardOrLater = floor(NSAppKitVersionNumber) > 824; + + osx_foreground_hack(); + + // Install an event handler so the Quit menu entry works + // The proper way using NSApp setDelegate: and + // applicationShouldTerminate: does not work, + // probably NSApplication never installs its handler. + [[NSAppleEventManager sharedAppleEventManager] + setEventHandler:self + andSelector:@selector(handleQuitEvent:withReplyEvent:) + forEventClass:kCoreEventClass + andEventID:kAEQuitApplication]; + //init menu [self initMenu];