--- tk8.6.12/macosx/tkMacOSXDialog.c 2021-10-29 17:08:23.000000000 +0000 +++ tk8.6.12-patched/macosx/tkMacOSXDialog.c 2021-11-02 19:04:59.000000000 +0000 @@ -379,6 +379,7 @@ [NSApp tkFilePanelDidEnd:panel returnCode:modalReturnCode contextInfo:callbackInfo ]; + [parent endSheet:panel]; } } else { modalReturnCode = [panel runModal];