video/uikit: Do not use setNeedsUpdateOfPrefersPointerLocked on iOS SDKs older than 14

main
uyjulian 2021-10-21 22:50:33 -05:00 committed by Sam Lantinga
parent 8f58bb9cf8
commit 007b5463e8
1 changed files with 2 additions and 0 deletions

View File

@ -324,6 +324,7 @@ void
UIKit_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed) UIKit_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
{ {
#if !TARGET_OS_TV #if !TARGET_OS_TV
#if defined(__IPHONE_14_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_0
@autoreleasepool { @autoreleasepool {
SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata;
SDL_uikitviewcontroller *viewcontroller = data.viewcontroller; SDL_uikitviewcontroller *viewcontroller = data.viewcontroller;
@ -331,6 +332,7 @@ UIKit_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
[viewcontroller setNeedsUpdateOfPrefersPointerLocked]; [viewcontroller setNeedsUpdateOfPrefersPointerLocked];
} }
} }
#endif /* defined(__IPHONE_14_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_0 */
#endif /* !TARGET_OS_TV */ #endif /* !TARGET_OS_TV */
} }