From 1056c1fa5bb16802be8f061099de2e70450fa4f1 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 22 Aug 2005 14:18:15 +0000 Subject: [PATCH] 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/macosx/SDLMain.m b/src/main/macosx/SDLMain.m index 8068cee08..405ac2dfa 100644 --- a/src/main/macosx/SDLMain.m +++ b/src/main/macosx/SDLMain.m @@ -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;