mirror of
https://github.com/utmapp/UTM.git
synced 2026-10-12 02:24:01 +00:00
display(iOS): hide overlays on iOS 16+
The UIViewController patches do not work on iOS 16+ but for some reason only the Remote builds fail to hide it.
This commit is contained in:
@@ -56,8 +56,10 @@ struct VMWindowView: View {
|
||||
switch device {
|
||||
case .display(_, _):
|
||||
VMDisplayHostedView(vm: session.vm, device: device, state: $state)
|
||||
.prefersPersistentSystemOverlaysHidden()
|
||||
case .serial(_, _):
|
||||
VMDisplayHostedView(vm: session.vm, device: device, state: $state)
|
||||
.prefersPersistentSystemOverlaysHidden()
|
||||
}
|
||||
} else if !state.isBusy && state.isRunning {
|
||||
// headless
|
||||
@@ -307,3 +309,13 @@ fileprivate struct VMToolbarOrnamentModifier: ViewModifier {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
private extension View {
|
||||
func prefersPersistentSystemOverlaysHidden() -> some View {
|
||||
if #available(iOS 16, *) {
|
||||
return self.persistentSystemOverlays(.hidden)
|
||||
} else {
|
||||
return self
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user