浏览代码

【优化】特殊文档打开文档时,M2设备概率出现界面卡住的情况

lizhe 6 月之前
父节点
当前提交
a134852fdf

+ 7 - 2
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -237,9 +237,14 @@ import Cocoa
 //            if (self.document!.isLocked) {
 //
 //            } else {
-                listView.document = document
+                
 //            }
-                listView.document.delegate = self
+            
+            DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.3) {
+                self.listView.document = self.document
+                self.listView.document.delegate = self
+            }
+            
             let autoScale = listView.autoScales
             if !autoScale {
                 listView.scaleFactor = 1.0