mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 02:17:31 +00:00
fix(mobile): keep iPad page headers clear of the window controls (#38635)
* fix(mobile): keep iPad page headers clear of the window controls The reserved-regions probe reported the window's plain safe area, which on iPadOS 26+ windowed mode does not cover the window controls. On iOS 27.1+ pages take their top inset from that value, so the host header sat under the controls while native screens, which get the corner-adapted inset, cleared them. * fix(mobile): only raise the page's top inset for window controls
This commit is contained in:
@@ -103,12 +103,16 @@ public class OrcaReservedRegionsModule: Module {
|
||||
.intersection(window.bounds)
|
||||
keyboardInset = overlap.isNull ? 0 : overlap.height
|
||||
}
|
||||
// Same top as the root's (OrcaWindowControlsInset), so pages clear iPad window controls too.
|
||||
var safeAreaInsets = window.safeAreaInsets
|
||||
safeAreaInsets.top = max(
|
||||
safeAreaInsets.top, window.edgeInsets(for: .safeArea(cornerAdaptation: .vertical)).top)
|
||||
let snapshot = ReservedRegionsSnapshot(
|
||||
divisions: window.reservedRegions(kind: .division).map(\.frame),
|
||||
hasFoldDivision: !window.reservedRegions(kind: .division, options: .includeInactive).isEmpty,
|
||||
occlusions: window.reservedRegions(kind: .occlusion).map(\.frame),
|
||||
windowBounds: window.bounds,
|
||||
windowSafeAreaInsets: window.safeAreaInsets,
|
||||
windowSafeAreaInsets: safeAreaInsets,
|
||||
keyboardInset: keyboardInset
|
||||
)
|
||||
// The first layout always reports, so a listener starts from the real state.
|
||||
|
||||
Reference in New Issue
Block a user