summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXInit.c
diff options
context:
space:
mode:
authorculler <culler>2019-10-11 02:52:02 (GMT)
committerculler <culler>2019-10-11 02:52:02 (GMT)
commit53f2d52b7aede62164cd5eb413cc5c8912f45715 (patch)
tree57eb448a6e7b95341870262f2a04a98fd5d3b402 /macosx/tkMacOSXInit.c
parent38d9e5dd06e5431f02757936f1da6343fd3b1819 (diff)
downloadtk-53f2d52b7aede62164cd5eb413cc5c8912f45715.zip
tk-53f2d52b7aede62164cd5eb413cc5c8912f45715.tar.gz
tk-53f2d52b7aede62164cd5eb413cc5c8912f45715.tar.bz2
Fix bug[bf93d098d7]: Menubar is sometimes unresponsive on app startup
Diffstat (limited to 'macosx/tkMacOSXInit.c')
-rw-r--r--macosx/tkMacOSXInit.c11
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') {