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.
This commit is contained in:
Ryan C. Gordon 2005-08-22 14:18:15 +00:00
parent 8a33986f93
commit 1056c1fa5b

View File

@ -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;