mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-10-21 15:56:55 +00:00
Don't use pointer lock if the mouse isn't compatible with GCMouse
This commit is contained in:
1 parent
5043fadace
commit
88c18ad397
4 files changed
+25
-7
No files matched your search
@@ -383,6 +383,14 @@
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)mousePresenceChanged {
|
||||
#if !TARGET_OS_TV
|
||||
if (@available(iOS 14.0, *)) {
|
||||
[self setNeedsUpdateOfPrefersPointerLocked];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)userInteractionBegan {
|
||||
// Disable hiding home bar when user is interacting.
|
||||
// iOS will force it to be shown anyway, but it will
|
||||
@@ -434,7 +442,10 @@
|
||||
}
|
||||
|
||||
- (BOOL)prefersPointerLocked {
|
||||
return YES;
|
||||
// Pointer lock breaks the UIKit mouse APIs, which is a problem because
|
||||
// GCMouse is horribly broken on iOS 14.0 for certain mice. Only lock
|
||||
// the cursor if there is a GCMouse present.
|
||||
return [GCMouse mice].count > 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user