updateKeyboard should use the SDL window's screen instead of the view window's screen, which may be nil.

Fixes https://github.com/libsdl-org/SDL/issues/8200
This commit is contained in:
Sam Lantinga
2024-01-06 07:31:10 -08:00
parent e100992c17
commit 3a9a52fe6c

View File

@@ -511,12 +511,14 @@ static void SDLCALL SDL_HideHomeIndicatorHintChanged(void *userdata, const char
- (void)updateKeyboard
{
SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *) window->driverdata;
CGAffineTransform t = self.view.transform;
CGPoint offset = CGPointMake(0.0, 0.0);
#if TARGET_OS_XR
CGRect frame = UIKit_ComputeViewFrame(window);
#else
CGRect frame = UIKit_ComputeViewFrame(window, self.view.window.screen);
CGRect frame = UIKit_ComputeViewFrame(window, data.uiwindow.screen);
#endif
if (self.keyboardHeight) {