Apparently MacOS X will sometimes pass command line arguments to a Cocoa
authorRyan C. Gordon <icculus@icculus.org>
Mon, 22 Aug 2005 14:18:15 +0000
changeset 1125a6011e1394d9
parent 1124 4a061326d752
child 1126 d581fe3f36db
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.
src/main/macosx/SDLMain.m
     1.1 --- a/src/main/macosx/SDLMain.m	Sun Aug 21 08:02:23 2005 +0000
     1.2 +++ b/src/main/macosx/SDLMain.m	Mon Aug 22 14:18:15 2005 +0000
     1.3 @@ -245,6 +245,9 @@
     1.4   */
     1.5  - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
     1.6  {
     1.7 +    if (!gFinderLaunch)  /* MacOS is passing command line args. */
     1.8 +        return FALSE;
     1.9 +
    1.10      if (gCalledAppMainline)  /* app has started, ignore this document. */
    1.11          return FALSE;
    1.12