mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
Fixed mouse focus for touch events on iOS
This commit is contained in:
parent
4bd808346a
commit
582a3c994d
@ -160,12 +160,6 @@ SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bool created)
|
|||||||
* heirarchy. */
|
* heirarchy. */
|
||||||
[view setSDLWindow:window];
|
[view setSDLWindow:window];
|
||||||
|
|
||||||
/* Make this window the current mouse focus for touch input */
|
|
||||||
if (displaydata.uiscreen == [UIScreen mainScreen]) {
|
|
||||||
SDL_SetMouseFocus(window);
|
|
||||||
SDL_SetKeyboardFocus(window);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,6 +249,14 @@ UIKit_ShowWindow(_THIS, SDL_Window * window)
|
|||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata;
|
SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata;
|
||||||
[data.uiwindow makeKeyAndVisible];
|
[data.uiwindow makeKeyAndVisible];
|
||||||
|
|
||||||
|
/* Make this window the current mouse focus for touch input */
|
||||||
|
SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
|
||||||
|
SDL_DisplayData *displaydata = (__bridge SDL_DisplayData *) display->driverdata;
|
||||||
|
if (displaydata.uiscreen == [UIScreen mainScreen]) {
|
||||||
|
SDL_SetMouseFocus(window);
|
||||||
|
SDL_SetKeyboardFocus(window);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user