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.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401126
This commit is contained in:
Ryan C. Gordon 2005-08-22 14:18:15 +00:00
parent 447103bbe0
commit a3e073d82b

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;