diff --git a/Cocoa.m b/Cocoa.m index cb159e5..3b382bb 100644 --- a/Cocoa.m +++ b/Cocoa.m @@ -73,6 +73,9 @@ - (void) prepareOpenGL { [[self window] setLevel: NSNormalWindowLevel]; [[self window] makeKeyAndOrderFront: self]; + + // Activate the application (i.e. give it focus). + [NSApp activateIgnoringOtherApps:YES]; // Make all the OpenGL calls to setup rendering and build the necessary rendering objects [[self openGLContext] makeCurrentContext]; diff --git a/README.md b/README.md index 52363ac..112f80a 100644 --- a/README.md +++ b/README.md @@ -1207,6 +1207,9 @@ static CVReturn GlobalDisplayLinkCallback(CVDisplayLinkRef, const CVTimeStamp*, [[self window] setLevel: NSNormalWindowLevel]; [[self window] makeKeyAndOrderFront: self]; + + // Activate the application (i.e. give it focus). + [NSApp activateIgnoringOtherApps:YES]; // Make all the OpenGL calls to setup rendering and build the necessary rendering objects [[self openGLContext] makeCurrentContext];