Repo // Enable CGShieldingWindowLevel().

- We use the max value between CGShieldingWindowLevel() and kCGPopUpMenuWindowLevel.
This commit is contained in:
ShikiSuen 2023-02-05 09:44:45 +08:00
parent 361a99ccf3
commit 0d3a727d9d
5 changed files with 6 additions and 8 deletions

View File

@ -74,7 +74,7 @@ public class CtlCandidateTDK: CtlCandidate {
let panel = NSPanel(
contentRect: contentRect, styleMask: styleMask, backing: .buffered, defer: false
)
panel.level = NSWindow.Level(Int(kCGPopUpMenuWindowLevel) + 2)
panel.level = NSWindow.Level(Int(max(CGShieldingWindowLevel(), kCGPopUpMenuWindowLevel)) + 2)
panel.hasShadow = true
panel.isOpaque = false
panel.backgroundColor = NSColor.clear

View File

@ -97,7 +97,7 @@ public class Notifier: NSWindowController {
)
theWindow.contentView = transparentVisualEffect
theWindow.isMovableByWindowBackground = true
theWindow.level = NSWindow.Level(Int(kCGPopUpMenuWindowLevel))
theWindow.level = NSWindow.Level(Int(max(CGShieldingWindowLevel(), kCGPopUpMenuWindowLevel)))
theWindow.hasShadow = true
theWindow.backgroundColor = .textBackgroundColor
theWindow.title = ""

View File

@ -32,7 +32,7 @@ public class PopupCompositionBuffer: NSWindowController {
let panel = NSPanel(
contentRect: contentRect, styleMask: styleMask, backing: .buffered, defer: false
)
panel.level = NSWindow.Level(Int(kCGPopUpMenuWindowLevel) + 1)
panel.level = NSWindow.Level(Int(max(CGShieldingWindowLevel(), kCGPopUpMenuWindowLevel)) + 1)
panel.hasShadow = true
panel.backgroundColor = NSColor.controlBackgroundColor
panel.styleMask = .fullSizeContentView

View File

@ -34,7 +34,7 @@ public class TooltipUI: NSWindowController {
let panel = NSPanel(
contentRect: contentRect, styleMask: styleMask, backing: .buffered, defer: false
)
panel.level = NSWindow.Level(Int(kCGPopUpMenuWindowLevel) + 2)
panel.level = NSWindow.Level(Int(max(CGShieldingWindowLevel(), kCGPopUpMenuWindowLevel)) + 2)
panel.hasShadow = true
panel.backgroundColor = NSColor.controlBackgroundColor
panel.isMovable = false

View File

@ -73,7 +73,7 @@ extension SessionCtl {
}
public func showCandidates() {
guard let client = client() else { return }
guard client() != nil else { return }
updateVerticalTypingStatus()
isVerticalCandidateWindow = (isVerticalTyping || !PrefMgr.shared.useHorizontalCandidateList)
@ -127,9 +127,7 @@ extension SessionCtl {
if #available(macOS 10.14, *) {
// Spotlight IMK
if let ctlCandidateCurrent = candidateUI as? CtlCandidateIMK {
while ctlCandidateCurrent.windowLevel() <= client.windowLevel() {
ctlCandidateCurrent.setWindowLevel(UInt64(max(0, client.windowLevel() + 1000)))
}
ctlCandidateCurrent.setWindowLevel(UInt64(CGShieldingWindowLevel() + 2))
}
}