From ec5cb9c6f70e274184027def5da1ad865c0b7c2e Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 7 Nov 2013 18:03:39 +0100 Subject: [PATCH] Moved to Cocoa for transformation and activation. --- README.md | 1 + src/cocoa_window.m | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 26ed1525..dba6a0a7 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ guide in the GLFW documentation. unfocused windows - [Cocoa] Added dependency on CoreVideo framework for refresh rate retrieval - [Cocoa] Enabled Lion full screen for resizable windowed mode windows + - [Cocoa] Moved to Cocoa API for application transformation and activation - [Cocoa] Bugfix: The `GLFW_KEY_GRAVE_ACCENT` key was reported as `GLFW_KEY_WORLD_1` and vice versa - [Cocoa] Bugfix: The `GLFW_KEY_F13` key was reported as diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 5010a19a..7bc85b93 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -827,13 +827,11 @@ static GLboolean initializeAppKit(void) // Implicitly create shared NSApplication instance [GLFWApplication sharedApplication]; - // If we get here, the application is unbundled - ProcessSerialNumber psn = { 0, kCurrentProcess }; - TransformProcessType(&psn, kProcessTransformToForegroundApplication); + // In case we are unbundled, make us a proper UI application + [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; - // Having the app in front of the terminal window is also generally - // handy. There is an NSApplication API to do this, but... - SetFrontProcess(&psn); + // Make us the active application + [NSApp activateIgnoringOtherApps:YES]; #if defined(_GLFW_USE_MENUBAR) // Menu bar setup must go between sharedApplication above and