# HG changeset patch # User Ryan C. Gordon # Date 1124720295 0 # Node ID a6011e1394d998cc85a008630f7f7363a80bb992 # Parent 4a061326d7528823659abe5a688ed7499152431c 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. diff -r 4a061326d752 -r a6011e1394d9 src/main/macosx/SDLMain.m --- a/src/main/macosx/SDLMain.m Sun Aug 21 08:02:23 2005 +0000 +++ b/src/main/macosx/SDLMain.m Mon Aug 22 14:18:15 2005 +0000 @@ -245,6 +245,9 @@ */ - (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;