From e33e061e963601911aa80afe6279fde9cfb89eb9 Mon Sep 17 00:00:00 2001 From: Marco Antognini Date: Sat, 17 May 2014 13:27:18 +0200 Subject: [PATCH] Replaced deprecated functions on OS X 10.9 --- src/SFML/Window/OSX/WindowImplCocoa.mm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/SFML/Window/OSX/WindowImplCocoa.mm b/src/SFML/Window/OSX/WindowImplCocoa.mm index 93608c823..3502ecef7 100644 --- a/src/SFML/Window/OSX/WindowImplCocoa.mm +++ b/src/SFML/Window/OSX/WindowImplCocoa.mm @@ -207,13 +207,12 @@ void WindowImplCocoa::setUpProcess(void) // Do it only once ! isTheProcessSetAsApplication = true; - // Set the process as a normal application so it can get focus. - ProcessSerialNumber psn; - if (!GetCurrentProcess(&psn)) - { - TransformProcessType(&psn, kProcessTransformToForegroundApplication); - SetFrontProcess(&psn); - } + // Make sure NSApp is properly initialized + [SFApplication sharedApplication]; + + // Set the process as a normal application so it can get focus + [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; + [NSApp activateIgnoringOtherApps:YES]; // Register an application delegate if there is none if (![[SFApplication sharedApplication] delegate])