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:
parent
447103bbe0
commit
a3e073d82b
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue