mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Add workaround for unwanted sheet bug
This commit is contained in:
parent
eb9b1c7145
commit
8a34a8c701
@ -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.
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user