From 8f65cbf6e33dfcb2e8269e6bf2a8a50aea50b863 Mon Sep 17 00:00:00 2001 From: Scott J Maddox Date: Sun, 28 Jul 2019 16:49:53 -0500 Subject: [PATCH] activate application activate the application by calling `[NSApp activateIgnoringOtherApps:YES]`, after making the window key and front. --- Cocoa.m | 3 +++ README.md | 3 +++ 2 files changed, 6 insertions(+) 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];