diff --git a/docs/changes.txt b/docs/changes.txt index abb9a61a6b..4c5f58fe8e 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -128,6 +128,7 @@ wxOSX: - Implement wxDataViewChoiceByIndexRenderer (wanup). - Fix unnecessary indentation in list-like wxDataViewCtrl (Andreas Falkenhahn). - Recognize macOS 10.12 Sierra in wxGetOsDescription() (Tobias Taschner). +- Don't try to open command line arguments as files (Jeff Hostetler). Unix: diff --git a/src/osx/cocoa/utils.mm b/src/osx/cocoa/utils.mm index 02c18c47f9..7636672002 100644 --- a/src/osx/cocoa/utils.mm +++ b/src/osx/cocoa/utils.mm @@ -421,6 +421,11 @@ bool wxApp::DoInitGui() } gNSLayoutManager = [[NSLayoutManager alloc] init]; + // This call makes it so that appplication:openFile: doesn't get bogus calls + // from Cocoa doing its own parsing of the argument string. And yes, we need + // to use a string with a boolean value in it. That's just how it works. + [[NSUserDefaults standardUserDefaults] setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"]; + return true; }