mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Fix calling UI from a background thread
This commit is contained in:
parent
6d49fd1aba
commit
857dfcecd7
@ -16,6 +16,7 @@ unreleased
|
||||
- Fix an issue where `⌘←` was ignored when the cursor locates at the end of the document.
|
||||
- Fix an issue where save dialog layout crrupted when toggle visibility of the file browser.
|
||||
- Fix an issue where no alart was raised on saving even when document contains lossy yen signs.
|
||||
- Fix a possible crash on print.
|
||||
|
||||
|
||||
|
||||
|
@ -641,7 +641,7 @@ final class Document: NSDocument, AdditionalDocumentPreparing, EncodingHolder {
|
||||
printOperation.canSpawnSeparateThread = true // display print progress panel as a sheet
|
||||
|
||||
// setup print panel
|
||||
self.printPanelAccessoryController.view.setContentHuggingPriority(.fittingSizeCompression, for: .horizontal)
|
||||
printOperation.printPanel.addAccessoryController(self.printPanelAccessoryController)
|
||||
printOperation.printPanel.options.formUnion([.showsPaperSize, .showsOrientation, .showsScaling])
|
||||
|
||||
return printOperation
|
||||
|
@ -385,7 +385,9 @@ final class PrintTextView: NSTextView, NSLayoutManagerDelegate, Themable {
|
||||
}
|
||||
if let controller = NSPrintOperation.current?.printPanel.accessoryControllers.first as? PrintPanelAccessoryController {
|
||||
self.syntaxStyle?.highlightAll { [weak controller] in
|
||||
if let controller = controller, !controller.view.isHidden {
|
||||
DispatchQueue.main.async {
|
||||
guard let controller = controller, !controller.view.isHidden else { return }
|
||||
|
||||
controller.needsUpdatePreview = true
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user