mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-12 20:55:56 +00:00
sdl: Respect text input main thread requirements. (#2138)
This commit is contained in:
parent
4f2f9494b0
commit
4719d32295
3 changed files with 23 additions and 28 deletions
|
@ -205,7 +205,9 @@ void WindowSDL::InitTimers() {
|
|||
|
||||
void WindowSDL::RequestKeyboard() {
|
||||
if (keyboard_grab == 0) {
|
||||
SDL_StartTextInput(window);
|
||||
SDL_RunOnMainThread(
|
||||
[](void* userdata) { SDL_StartTextInput(static_cast<SDL_Window*>(userdata)); }, window,
|
||||
true);
|
||||
}
|
||||
keyboard_grab++;
|
||||
}
|
||||
|
@ -214,7 +216,9 @@ void WindowSDL::ReleaseKeyboard() {
|
|||
ASSERT(keyboard_grab > 0);
|
||||
keyboard_grab--;
|
||||
if (keyboard_grab == 0) {
|
||||
SDL_StopTextInput(window);
|
||||
SDL_RunOnMainThread(
|
||||
[](void* userdata) { SDL_StopTextInput(static_cast<SDL_Window*>(userdata)); }, window,
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue