Tk Source Code

Artifact [e05a2f63]
Login

Artifact e05a2f6321c15001458b59b0ad434f910203ae4b4a0c5c4eb309b2145241be5f:

Attachment "canBecomeKey.patch" to ticket [d4d89d13] added by marc_culler 2026-03-22 02:10:13.
Index: macosx/tkMacOSXWm.c
==================================================================
--- macosx/tkMacOSXWm.c
+++ macosx/tkMacOSXWm.c
@@ -626,10 +626,14 @@
     return frameSize;
 }
 
 - (BOOL) canBecomeKeyWindow
 {
+    if ([NSApp tkWillExit]) {
+	return NO;
+    }
+
     TkWindow *winPtr = TkMacOSXGetTkWindow(self);
 
     if (!winPtr || !winPtr->wmInfoPtr) {
 	return NO;
     }