changeset 1125:a6011e1394d9

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.
author Ryan C. Gordon <icculus@icculus.org>
date Mon, 22 Aug 2005 14:18:15 +0000
parents 4a061326d752
children d581fe3f36db
files src/main/macosx/SDLMain.m
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;