diff options
author | culler <culler> | 2019-10-20 03:40:57 (GMT) |
---|---|---|
committer | culler <culler> | 2019-10-20 03:40:57 (GMT) |
commit | 6546a84e4b271d471fb1117548f46a8a529688f9 (patch) | |
tree | dc03f028c58d94ae44e981dbe92d749cac2c3dd8 | |
parent | 1a24593842aae88beb8e408ac1770f7a36d91954 (diff) | |
parent | 53f2d52b7aede62164cd5eb413cc5c8912f45715 (diff) | |
download | tk-6546a84e4b271d471fb1117548f46a8a529688f9.zip tk-6546a84e4b271d471fb1117548f46a8a529688f9.tar.gz tk-6546a84e4b271d471fb1117548f46a8a529688f9.tar.bz2 |
Partial fix for [bf93d098d7]: On macOS Catalina menus can be unresponsive at app startup.
-rw-r--r-- | macosx/tkMacOSXInit.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index 848b500..2ba4d28 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -116,12 +116,18 @@ static char scriptPath[PATH_MAX + 1] = ""; -(void)applicationDidFinishLaunching:(NSNotification *)notification { - /* * It is not safe to force activation of the NSApp until this method is * called. Activating too early can cause the menu bar to be unresponsive. + * The call to activateIgnoringOtherApps was moved here to avoid this. + * However, with the release of macOS 10.15 (Catalina) this was no longer + * sufficient. (See ticket bf93d098d7.) Apparently apps were being + * activated automatically, and this was sometimes being done too early. + * As a workaround we deactivate and then reactivate the app, even though + * Apple says that "Normally, you shouldn’t invoke this method". */ + [NSApp deactivate]; [NSApp activateIgnoringOtherApps: YES]; /* @@ -182,6 +188,7 @@ static char scriptPath[PATH_MAX + 1] = ""; * If no icon has been set from an Info.plist file, use the Wish icon from * the Tk framework. */ + NSString *iconFile = [[NSBundle mainBundle] objectForInfoDictionaryKey: @"CFBundleIconFile"]; if (!iconFile) { @@ -396,7 +403,6 @@ TkpInit( } } - /* * Initialize the NSServices object here. Apple's docs say to do this * in applicationDidFinishLaunching, but the Tcl interpreter is not @@ -405,7 +411,6 @@ TkpInit( */ TkMacOSXServices_Init(interp); - } if (tkLibPath[0] != '\0') { |