Browse Source

Fixed love.app opening in the background instead of the foreground in OS X

Alex Szpakowski 12 years ago
parent
commit
b090a91650
1 changed files with 9 additions and 0 deletions
  1. 9 0
      platform/macosx/SDLMain.m

+ 9 - 0
platform/macosx/SDLMain.m

@@ -229,6 +229,15 @@ static void CustomApplicationMain (int argc, char **argv)
 				if (!CPSSetFrontProcess(&PSN))
 					[SDLApplication sharedApplication];
 	}
+#else
+	{
+		ProcessSerialNumber psn;
+
+		if (!GetCurrentProcess(&psn)) {
+			TransformProcessType(&psn, kProcessTransformToForegroundApplication);
+			SetFrontProcess(&psn);
+		}
+	}
 #endif /* SDL_USE_CPS */
 
 	/* Set up the menubar */