Prevent Cocoa from sending us open file events from command line args

We process command line args ourselves, thank you very much.
This commit is contained in:
Kovid Goyal 2021-03-11 10:59:03 +05:30
parent 077097c112
commit 399c700939
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -546,8 +546,12 @@ int _glfwPlatformInit(void)
if (_glfw.hints.init.ns.chdir)
changeToResourcesDirectory();
NSDictionary* defaults = @{
// Press and Hold prevents some keys from emitting repeated characters
NSDictionary* defaults = @{@"ApplePressAndHoldEnabled":@NO};
@"ApplePressAndHoldEnabled": @NO,
// Dont generate openFile events from command line arguments
@"NSTreatUnknownArgumentsAsOpen": @"NO",
};
[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
[[NSNotificationCenter defaultCenter]