Skip to content
Permalink
Browse files

Apparently MacOS X will sometimes pass command line arguments to a Cocoa

 app as an openFile() message, so we have to make sure we were launched from
 the Finder before accepting these as drag'n'drop documents, or they will just
 duplicate what's already in argc/argv.
  • Loading branch information
icculus committed Aug 22, 2005
1 parent 8b01c09 commit 84e543fb049f9e6eb8cdb9ead7a45fec0a36c2d0
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/main/macosx/SDLMain.m
@@ -245,6 +245,9 @@ static void CustomApplicationMain (argc, argv)
*/
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
{
if (!gFinderLaunch) /* MacOS is passing command line args. */
return FALSE;

if (gCalledAppMainline) /* app has started, ignore this document. */
return FALSE;

0 comments on commit 84e543f

Please sign in to comment.