From f2d0cc877810aeda5de400de85011f7f71ce6734 Mon Sep 17 00:00:00 2001 From: VenusIsJaded Date: Fri, 15 May 2026 22:00:53 -0500 Subject: [PATCH] fix: hide status bar when locked to landscape on iPad --- iosApp/iosApp/ContentView.swift | 8 ++++---- iosApp/iosApp/OrientationLockCoordinator.swift | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iosApp/iosApp/ContentView.swift b/iosApp/iosApp/ContentView.swift index 14f5664a..66efaafe 100644 --- a/iosApp/iosApp/ContentView.swift +++ b/iosApp/iosApp/ContentView.swift @@ -370,15 +370,15 @@ final class RootComposeViewController: UIViewController, UITabBarDelegate { } override var childForHomeIndicatorAutoHidden: UIViewController? { - immersiveController(in: contentController) ?? contentController + OrientationLockCoordinator.shared.supportedOrientations == .landscape ? nil : (immersiveController(in: contentController) ?? contentController) } override var childForScreenEdgesDeferringSystemGestures: UIViewController? { - immersiveController(in: contentController) ?? contentController + OrientationLockCoordinator.shared.supportedOrientations == .landscape ? nil : (immersiveController(in: contentController) ?? contentController) } override var childForStatusBarHidden: UIViewController? { - immersiveController(in: contentController) ?? contentController + OrientationLockCoordinator.shared.supportedOrientations == .landscape ? nil : (immersiveController(in: contentController) ?? contentController) } override var prefersHomeIndicatorAutoHidden: Bool { @@ -390,7 +390,7 @@ final class RootComposeViewController: UIViewController, UITabBarDelegate { } override var prefersStatusBarHidden: Bool { - immersiveController(in: contentController)?.prefersStatusBarHidden ?? false + OrientationLockCoordinator.shared.supportedOrientations == .landscape ? true : (immersiveController(in: contentController)?.prefersStatusBarHidden ?? false) } override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation { diff --git a/iosApp/iosApp/OrientationLockCoordinator.swift b/iosApp/iosApp/OrientationLockCoordinator.swift index 26d80c43..9e184e5d 100644 --- a/iosApp/iosApp/OrientationLockCoordinator.swift +++ b/iosApp/iosApp/OrientationLockCoordinator.swift @@ -102,7 +102,7 @@ final class OrientationLockCoordinator { .compactMap { $0 as? UIWindowScene } .flatMap(\.windows) .forEach { window in - window.rootViewController?.setNeedsUpdateOfSupportedInterfaceOrientations() + window.rootViewController?.setNeedsUpdateOfSupportedInterfaceOrientations(); window.rootViewController?.setNeedsStatusBarAppearanceUpdate() } } else { if forceRotate {