Add workaround for unwanted sheet bug

This commit is contained in:
1024jp 2018-09-03 00:45:02 +09:00
parent eb9b1c7145
commit 8a34a8c701
2 changed files with 20 additions and 0 deletions

View File

@ -12,6 +12,7 @@ Change Log
### Fixes
- Fix an issue where an unhidable empty progress dialog was displayed if another dialog was displayed when the task started.
- Address an issue where the application could rarely crash during syntax highlighting.

View File

@ -97,6 +97,25 @@ final class ProgressViewController: NSViewController {
// MARK: View Controller Methods
/// dismiss view
override func dismiss(_ sender: Any?) {
// close sheet in an old way
// -> Otherwise, a meanless empty sheet shows up after another sheet is closed
// if the receiver was presented and dismissed during another sheet is already presented. (2018-09 macOS 10.12)
if let parentWindow = self.presenting?.view.window,
let sheetWindow = self.view.window,
parentWindow.sheets.count > 1 {
parentWindow.endSheet(sheetWindow)
}
super.dismiss(sender)
}
// MARK: Public Methods
/// change button to done