Keep the landscape panel hidden where the corner layout doesn't fit

The corner preset's landscape fallback opened the panel whenever the
device could host the corner layout. On the iPhone Duo exterior display
the player falls back to the widescreen layout, so the floating panel
opened on every rotation into landscape. Resolve the fallback from
whether the corner layout fits the current size instead.
This commit is contained in:
Arkadiusz Fal
2026-10-13 23:57:58 +02:00
parent b900c7baad
commit f289905dd8
4 changed files with 41 additions and 7 deletions

View File

@@ -500,12 +500,20 @@ struct PanelSettings: Codable, Hashable, Sendable {
/// landscape in the corner layout on a device that can show it, where the
/// panels are the point of the layout and open visible.
func effectiveDefaultVisibility(for orientation: PanelOrientation) -> PanelDefaultVisibility {
effectiveDefaultVisibility(for: orientation, cornerLayoutFits: Self.canHostCornerLayout)
}
/// Same as `effectiveDefaultVisibility(for:)`, but the corner fallback
/// follows whether the corner layout fits the current screen — the iPhone
/// Duo exterior display can't host it and falls back to the floating
/// widescreen panel, which must not open by default.
func effectiveDefaultVisibility(for orientation: PanelOrientation, cornerLayoutFits: Bool) -> PanelDefaultVisibility {
switch orientation {
case .portrait:
return portraitDefaultVisibility ?? defaultVisibility ?? .visible
case .landscape:
let fallback: PanelDefaultVisibility =
effectiveLayoutMode == .corner && Self.canHostCornerLayout ? .visible : .hidden
effectiveLayoutMode == .corner && cornerLayoutFits ? .visible : .hidden
return landscapeDefaultVisibility ?? defaultVisibility ?? fallback
}
}