Voltaire & Tooltip & PCB, etc. // Fix NSWindow positioning.

This commit is contained in:
ShikiSuen 2022-09-15 11:17:07 +08:00
parent 5249ff5c0c
commit 1909e85a02
4 changed files with 4 additions and 4 deletions

View File

@ -161,7 +161,7 @@ public class ctlCandidate: NSWindowController, ctlCandidateProtocol {
var adjustedPoint = windowTopLeftPoint
var delta = heightDelta
var screenFrame = NSScreen.main?.visibleFrame ?? NSRect.seniorTheBeast
for frame in NSScreen.screens.map(\.visibleFrame).filter({ !$0.contains(windowTopLeftPoint) }) {
for frame in NSScreen.screens.map(\.visibleFrame).filter({ $0.contains(windowTopLeftPoint) }) {
screenFrame = frame
break
}

View File

@ -168,7 +168,7 @@ public class ctlCandidateIMK: IMKCandidates, ctlCandidateProtocol {
let windowSize = candidateFrame().size
var delta = heightDelta
var screenFrame = NSScreen.main?.visibleFrame ?? NSRect.seniorTheBeast
for frame in NSScreen.screens.map(\.visibleFrame).filter({ !$0.contains(windowTopLeftPoint) }) {
for frame in NSScreen.screens.map(\.visibleFrame).filter({ $0.contains(windowTopLeftPoint) }) {
screenFrame = frame
break
}

View File

@ -146,7 +146,7 @@ public class ctlPopupCompositionBuffer: NSWindowController {
var adjustedPoint = windowOrigin
var screenFrame = NSScreen.main?.visibleFrame ?? NSRect.seniorTheBeast
for frame in NSScreen.screens.map(\.visibleFrame).filter({ !$0.contains(windowOrigin) }) {
for frame in NSScreen.screens.map(\.visibleFrame).filter({ $0.contains(windowOrigin) }) {
screenFrame = frame
break
}

View File

@ -130,7 +130,7 @@ public class ctlTooltip: NSWindowController {
var adjustedPoint = windowTopLeftPoint
var delta = heightDelta
var screenFrame = NSScreen.main?.visibleFrame ?? NSRect.seniorTheBeast
for frame in NSScreen.screens.map(\.visibleFrame).filter({ !$0.contains(windowTopLeftPoint) }) {
for frame in NSScreen.screens.map(\.visibleFrame).filter({ $0.contains(windowTopLeftPoint) }) {
screenFrame = frame
break
}