Only lock the pointer for mouse relative mode, there isn't really a concept of grab and confinement on iOS

Locking the pointer prevents the on-screen cursor from moving, which isn't what we want with a grab behavior.

Fixes https://github.com/libsdl-org/SDL/issues/4941
This commit is contained in:
Sam Lantinga
2021-11-11 07:49:38 -08:00
parent 66a08aa391
commit 11ae43ca16
5 changed files with 16 additions and 15 deletions

View File

@@ -250,14 +250,7 @@ SDL_HideHomeIndicatorHintChanged(void *userdata, const char *name, const char *o
- (BOOL)prefersPointerLocked
{
SDL_VideoDevice *_this = SDL_GetVideoDevice();
if (SDL_HasGCMouse() &&
(SDL_GCMouseRelativeMode() || _this->grabbed_window == window)) {
return YES;
} else {
return NO;
}
return SDL_GCMouseRelativeMode() ? YES : NO;
}
#endif /* !TARGET_OS_TV */