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)
This commit is contained in:
Sam Lantinga 2024-01-06 07:31:10 -08:00
parent 674e894574
commit f892ae10d6

View file

@ -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;