File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Sources/KeyboardLayoutGuide Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -122,12 +122,16 @@ open class KeyboardLayoutGuide: UILayoutGuide {
122
122
let intersectionFrame = activeWindow. frame. intersection ( owningFrameInRoot)
123
123
124
124
let windowHeight = activeWindow. frame. height
125
- let bottomDifference = windowHeight - ( intersectionFrame. height + intersectionFrame . origin . y )
125
+ let bottomDifference = windowHeight - intersectionFrame. maxY
126
126
127
127
height -= bottomDifference
128
128
}
129
129
130
-
130
+ guard height != . infinity else {
131
+ // When the app is running in multiple windows, it can happen that both windows are `foregroundActive`
132
+ // and the intersection frame's origin can become infinite as the owning view is in the other window and the app would crash.
133
+ return
134
+ }
131
135
heightConstraint? . constant = height
132
136
if duration > 0.0 {
133
137
animate ( note)
You can’t perform that action at this time.
0 commit comments