From 31e2b017aea8e5fc2efd8f679a478867b8c2b2e6 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Mon, 5 Jun 2023 20:33:27 +0800 Subject: [PATCH] TDKCandidates // Refine OS version check methods. --- .../TDKCandidates/CtlCandidateTDK.swift | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/TDKCandidates/CtlCandidateTDK.swift b/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/TDKCandidates/CtlCandidateTDK.swift index 76dd9283..e5571980 100644 --- a/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/TDKCandidates/CtlCandidateTDK.swift +++ b/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/TDKCandidates/CtlCandidateTDK.swift @@ -108,18 +108,13 @@ public class CtlCandidateTDK: CtlCandidate, NSWindowDelegate { DispatchQueue.main.async { [self] in window.isOpaque = false window.backgroundColor = .clear - viewCheck: if #available(macOS 10.15, *) { - if useCocoa { - // if !NSApplication.isAppleSilicon { - // updateNSWindowLegacy(window) - // return - // } - Self.currentView = theViewCocoa + viewCheck: do { + viewCheckCatalina: if #available(macOS 10.15, *) { + if useCocoa { break viewCheckCatalina } + Self.thePool.update() + Self.currentView = NSHostingView(rootView: theView) break viewCheck } - Self.thePool.update() - Self.currentView = NSHostingView(rootView: theView) - } else { Self.currentView = theViewCocoa } window.contentView = Self.currentView