Request pointer lock while streaming

This commit is contained in:
Cameron Gutman
2020-09-18 18:27:20 -05:00
parent 6fa5ef73f6
commit 5043fadace
2 changed files with 14 additions and 9 deletions
@@ -1387,15 +1387,11 @@ const int FrontViewPositionNone = 0xff;
// These are derived from the primary view controller // These are derived from the primary view controller
if (@available(iOS 11.0, *)) { if (@available(iOS 11.0, *)) {
// iOS 11 betas (which are still installed in some places :\) crash with [self setNeedsUpdateOfHomeIndicatorAutoHidden];
// doesNotRecognizeSelector since this wasn't added until after the iPhone X [self setNeedsUpdateOfScreenEdgesDeferringSystemGestures];
// announcement. }
if ([self respondsToSelector: @selector(setNeedsUpdateOfHomeIndicatorAutoHidden)]) { if (@available(iOS 14.0, *)) {
[self setNeedsUpdateOfHomeIndicatorAutoHidden]; [self setNeedsUpdateOfPrefersPointerLocked];
}
if ([self respondsToSelector: @selector(setNeedsUpdateOfScreenEdgesDeferringSystemGestures)]) {
[self setNeedsUpdateOfScreenEdgesDeferringSystemGestures];
}
} }
} }
@@ -1409,6 +1405,11 @@ const int FrontViewPositionNone = 0xff;
return _primaryViewController; return _primaryViewController;
} }
- (UIViewController*)childViewControllerForPointerLock
{
return _primaryViewController;
}
#pragma mark Animated view controller deployment and layout #pragma mark Animated view controller deployment and layout
// Primitive method for view controller deployment and animated layout to the given position. // Primitive method for view controller deployment and animated layout to the given position.
@@ -432,6 +432,10 @@
- (BOOL)shouldAutorotate { - (BOOL)shouldAutorotate {
return YES; return YES;
} }
- (BOOL)prefersPointerLocked {
return YES;
}
#endif #endif
@end @end