1.1 --- a/src/video/uikit/SDL_uikitwindow.m Mon May 20 00:41:18 2019 -0400
1.2 +++ b/src/video/uikit/SDL_uikitwindow.m Mon May 20 14:08:35 2019 -0700
1.3 @@ -160,12 +160,6 @@
1.4 * heirarchy. */
1.5 [view setSDLWindow:window];
1.6
1.7 - /* Make this window the current mouse focus for touch input */
1.8 - if (displaydata.uiscreen == [UIScreen mainScreen]) {
1.9 - SDL_SetMouseFocus(window);
1.10 - SDL_SetKeyboardFocus(window);
1.11 - }
1.12 -
1.13 return 0;
1.14 }
1.15
1.16 @@ -255,6 +249,14 @@
1.17 @autoreleasepool {
1.18 SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata;
1.19 [data.uiwindow makeKeyAndVisible];
1.20 +
1.21 + /* Make this window the current mouse focus for touch input */
1.22 + SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
1.23 + SDL_DisplayData *displaydata = (__bridge SDL_DisplayData *) display->driverdata;
1.24 + if (displaydata.uiscreen == [UIScreen mainScreen]) {
1.25 + SDL_SetMouseFocus(window);
1.26 + SDL_SetKeyboardFocus(window);
1.27 + }
1.28 }
1.29 }
1.30