diff options
author | culler <culler> | 2021-10-27 15:01:09 (GMT) |
---|---|---|
committer | culler <culler> | 2021-10-27 15:01:09 (GMT) |
commit | 77257c0f79171da4fd01a11664615679bf3ea959 (patch) | |
tree | 4d90383efc7ec492415e151b0f7e140c157c3eca /macosx | |
parent | ede363592c3c712976122d329e548eb1dddf6976 (diff) | |
download | tk-77257c0f79171da4fd01a11664615679bf3ea959.zip tk-77257c0f79171da4fd01a11664615679bf3ea959.tar.gz tk-77257c0f79171da4fd01a11664615679bf3ea959.tar.bz2 |
The standalone file dialog needs the same fix as the sheet
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXDialog.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 08998bc..717c17d 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -350,9 +350,9 @@ static NSInteger showOpenSavePanel( FilePanelCallbackInfo *callbackInfo) { NSInteger modalReturnCode; + int osVersion = [NSApp macOSVersion]; if (parent && ![parent attachedSheet]) { - int osVersion = [NSApp macOSVersion]; [panel beginSheetModalForWindow:parent completionHandler:^(NSModalResponse returnCode) { [NSApp tkFilePanelDidEnd:panel @@ -385,20 +385,15 @@ static NSInteger showOpenSavePanel( * at all on macOS 10.14 and earlier. */ - if ([NSApp macOSVersion] > 101400) { - [panel beginWithCompletionHandler:^(NSModalResponse returnCode) { - [NSApp tkFilePanelDidEnd:panel - returnCode:returnCode - contextInfo:callbackInfo ]; - }]; + if ( osVersion > 101400 && osVersion < 120000) { modalReturnCode = [panel runModal]; } else { - modalReturnCode = [panel runModal]; - [NSApp tkFilePanelDidEnd:panel - returnCode:modalReturnCode - contextInfo:callbackInfo ]; - [panel close]; + modalReturnCode = [NSApp runModalForWindow:panel]; } + [NSApp tkFilePanelDidEnd:panel + returnCode:modalReturnCode + contextInfo:callbackInfo ]; + [panel close]; } return callbackInfo->cmdObj ? modalOther : modalReturnCode; } |