Skip to content

Commit 9202191

Browse files
committed
Prevent loading frame of all windows in the check
1 parent f3bd408 commit 9202191

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

Core/Sources/SuggestionWidget/WidgetWindowsController.swift

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -519,20 +519,17 @@ extension WidgetWindowsController {
519519
} else {
520520
guard let xcode = await xcodeInspector.safe.latestActiveXcode else { return }
521521
let windowElements = xcode.appElement.windows
522-
let windowRects = windowElements.compactMap {
522+
let overlap = windowElements.contains {
523523
if let position = $0.position, let size = $0.size {
524-
return CGRect(
524+
let rect = CGRect(
525525
x: position.x,
526526
y: position.y,
527527
width: size.width,
528528
height: size.height
529529
)
530+
return rect.intersects(window.frame)
530531
}
531-
return nil
532-
}
533-
534-
let overlap = windowRects.contains {
535-
$0.intersects(window.frame)
532+
return false
536533
}
537534

538535
window.setFloatOnTop(overlap)

0 commit comments

Comments
 (0)