diff options
author | culler <culler> | 2021-10-10 16:47:20 (GMT) |
---|---|---|
committer | culler <culler> | 2021-10-10 16:47:20 (GMT) |
commit | 8c27fc9372885b06557133dea05f8a45000196c9 (patch) | |
tree | cf7c1a36f258e549399f1f6516879f58f068d447 /macosx/tkMacOSXDialog.c | |
parent | 88bcb221923fb169035a482c8e6b6d6de06f592f (diff) | |
parent | f37694250c1164741ebb0085811291ffb0f11e51 (diff) | |
download | tk-8c27fc9372885b06557133dea05f8a45000196c9.zip tk-8c27fc9372885b06557133dea05f8a45000196c9.tar.gz tk-8c27fc9372885b06557133dea05f8a45000196c9.tar.bz2 |
Merge 8.6
Diffstat (limited to 'macosx/tkMacOSXDialog.c')
-rw-r--r-- | macosx/tkMacOSXDialog.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 1123346..fc50344 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -352,6 +352,7 @@ static NSInteger showOpenSavePanel( NSInteger modalReturnCode; if (parent && ![parent attachedSheet]) { + int osVersion = [NSApp macOSVersion]; [panel beginSheetModalForWindow:parent completionHandler:^(NSModalResponse returnCode) { [NSApp tkFilePanelDidEnd:panel @@ -364,10 +365,15 @@ static NSInteger showOpenSavePanel( * window. Using [NSApp runModalForWindow:] on macOS 10.15 or later * generates warnings on stderr. But using [NSOpenPanel runModal] or * [NSSavePanel runModal] on 10.14 or earler does not cause the - * completion handler to run when the panel is closed. + * completion handler to run when the panel is closed. Apple apparently + * decided to go back to using runModalForWindow with the release of + * macOS 12.0. The warnings do not appear in that OS, and using + * runModal produces an error dialog that says "The open file operation + * failed to connect to the open and save panel service." along with an + * assertion error. */ - if ([NSApp macOSVersion] > 101400) { + if ( osVersion >= 101400 && osVersion < 120000) { modalReturnCode = [panel runModal]; } else { modalReturnCode = [NSApp runModalForWindow:panel]; |