From f892ae10d62b19d57ba30e96681ae2e45191ee33 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 6 Jan 2024 07:31:10 -0800 Subject: [PATCH] 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 (cherry picked from commit 3a9a52fe6c40aee8d174bb756b4a339d35386633) --- src/video/uikit/SDL_uikitviewcontroller.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m index e473298a9..0d8052b7f 100644 --- a/src/video/uikit/SDL_uikitviewcontroller.m +++ b/src/video/uikit/SDL_uikitviewcontroller.m @@ -502,9 +502,11 @@ SDL_HideHomeIndicatorHintChanged(void *userdata, const char *name, const char *o - (void)updateKeyboard { + SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata; + CGAffineTransform t = self.view.transform; CGPoint offset = CGPointMake(0.0, 0.0); - CGRect frame = UIKit_ComputeViewFrame(window, self.view.window.screen); + CGRect frame = UIKit_ComputeViewFrame(window, data.uiwindow.screen); if (self.keyboardHeight) { int rectbottom = self.textInputRect.y + self.textInputRect.h;