diff options
author | Kevin Walzer <kw@codebykevin.com> | 2021-05-08 12:46:03 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2021-05-08 12:46:03 (GMT) |
commit | 7653fd57944db2a7fd92a7dc515faaf4d83026bc (patch) | |
tree | 5e539c0b3f40ebd1faf4f3ed65b2e560f604b559 /macosx/tkMacOSXInit.c | |
parent | e5c420ea9df8afb2f1f4f714b52869ea3dd26bd0 (diff) | |
download | tk-7653fd57944db2a7fd92a7dc515faaf4d83026bc.zip tk-7653fd57944db2a7fd92a7dc515faaf4d83026bc.tar.gz tk-7653fd57944db2a7fd92a7dc515faaf4d83026bc.tar.bz2 |
Merging fix for 7bb246b072, thanks to M. Wayne Davis for the report
Diffstat (limited to 'macosx/tkMacOSXInit.c')
-rw-r--r-- | macosx/tkMacOSXInit.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index d4edd56..c2de9ff 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -104,18 +104,37 @@ static int TkMacOSXGetAppPathCmd(ClientData cd, Tcl_Interp *ip, #endif [self _setupWindowNotifications]; [self _setupApplicationNotifications]; + +if ([NSApp macOSVersion] >= 110000) { + + /* + * Initialize Apple Event processing. Apple's docs (see + * https://developer.apple.com/documentation/appkit/nsapplication) + * recommend doing this here, although historically we have + * done this in applicationWillFinishLaunching. In response to + * bug 7bb246b072. + */ + + TkMacOSXInitAppleEvents(_eventInterp); + + } } -(void)applicationDidFinishLaunching:(NSNotification *)notification { (void)notification; + if ([NSApp macOSVersion] < 110000) { + /* - * Initialize event processing. + * Initialize Apple Event processing on macOS versions + * older than Big Sur (11). */ TkMacOSXInitAppleEvents(_eventInterp); + } + /* * Initialize the graphics context. */ |