Repo // Enable CGShieldingWindowLevel().
- We use the max value between CGShieldingWindowLevel() and kCGPopUpMenuWindowLevel.
This commit is contained in:
parent
361a99ccf3
commit
0d3a727d9d
|
@ -74,7 +74,7 @@ public class CtlCandidateTDK: CtlCandidate {
|
||||||
let panel = NSPanel(
|
let panel = NSPanel(
|
||||||
contentRect: contentRect, styleMask: styleMask, backing: .buffered, defer: false
|
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.hasShadow = true
|
||||||
panel.isOpaque = false
|
panel.isOpaque = false
|
||||||
panel.backgroundColor = NSColor.clear
|
panel.backgroundColor = NSColor.clear
|
||||||
|
|
|
@ -97,7 +97,7 @@ public class Notifier: NSWindowController {
|
||||||
)
|
)
|
||||||
theWindow.contentView = transparentVisualEffect
|
theWindow.contentView = transparentVisualEffect
|
||||||
theWindow.isMovableByWindowBackground = true
|
theWindow.isMovableByWindowBackground = true
|
||||||
theWindow.level = NSWindow.Level(Int(kCGPopUpMenuWindowLevel))
|
theWindow.level = NSWindow.Level(Int(max(CGShieldingWindowLevel(), kCGPopUpMenuWindowLevel)))
|
||||||
theWindow.hasShadow = true
|
theWindow.hasShadow = true
|
||||||
theWindow.backgroundColor = .textBackgroundColor
|
theWindow.backgroundColor = .textBackgroundColor
|
||||||
theWindow.title = ""
|
theWindow.title = ""
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class PopupCompositionBuffer: NSWindowController {
|
||||||
let panel = NSPanel(
|
let panel = NSPanel(
|
||||||
contentRect: contentRect, styleMask: styleMask, backing: .buffered, defer: false
|
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.hasShadow = true
|
||||||
panel.backgroundColor = NSColor.controlBackgroundColor
|
panel.backgroundColor = NSColor.controlBackgroundColor
|
||||||
panel.styleMask = .fullSizeContentView
|
panel.styleMask = .fullSizeContentView
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class TooltipUI: NSWindowController {
|
||||||
let panel = NSPanel(
|
let panel = NSPanel(
|
||||||
contentRect: contentRect, styleMask: styleMask, backing: .buffered, defer: false
|
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.hasShadow = true
|
||||||
panel.backgroundColor = NSColor.controlBackgroundColor
|
panel.backgroundColor = NSColor.controlBackgroundColor
|
||||||
panel.isMovable = false
|
panel.isMovable = false
|
||||||
|
|
|
@ -73,7 +73,7 @@ extension SessionCtl {
|
||||||
}
|
}
|
||||||
|
|
||||||
public func showCandidates() {
|
public func showCandidates() {
|
||||||
guard let client = client() else { return }
|
guard client() != nil else { return }
|
||||||
updateVerticalTypingStatus()
|
updateVerticalTypingStatus()
|
||||||
isVerticalCandidateWindow = (isVerticalTyping || !PrefMgr.shared.useHorizontalCandidateList)
|
isVerticalCandidateWindow = (isVerticalTyping || !PrefMgr.shared.useHorizontalCandidateList)
|
||||||
|
|
||||||
|
@ -127,9 +127,7 @@ extension SessionCtl {
|
||||||
if #available(macOS 10.14, *) {
|
if #available(macOS 10.14, *) {
|
||||||
// Spotlight 視窗會擋住 IMK 選字窗,所以需要特殊處理。
|
// Spotlight 視窗會擋住 IMK 選字窗,所以需要特殊處理。
|
||||||
if let ctlCandidateCurrent = candidateUI as? CtlCandidateIMK {
|
if let ctlCandidateCurrent = candidateUI as? CtlCandidateIMK {
|
||||||
while ctlCandidateCurrent.windowLevel() <= client.windowLevel() {
|
ctlCandidateCurrent.setWindowLevel(UInt64(CGShieldingWindowLevel() + 2))
|
||||||
ctlCandidateCurrent.setWindowLevel(UInt64(max(0, client.windowLevel() + 1000)))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue