changeset 35085:5a9728bbb51e

Move some code around in preparation for following patch.
author reimar
date Thu, 13 Sep 2012 19:15:37 +0000
parents 3be1bcf3f16b
children 8848682f4035
files libvo/vo_corevideo.m
diffstat 1 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- 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];