video: Remove SDL_GetFocusWindow()

It was rarely used and performed an identical function to SDL_GetKeyboardFocus(), but with worse time complexity.
This commit is contained in:
Frank Praznik
2023-09-16 15:36:01 -04:00
parent 39c2f97373
commit e5739d7d1f
9 changed files with 27 additions and 37 deletions

View File

@@ -732,7 +732,7 @@ static EM_BOOL Emscripten_HandleFocus(int eventType, const EmscriptenFocusEvent
}
sdl_event_type = (eventType == EMSCRIPTEN_EVENT_FOCUS) ? SDL_EVENT_WINDOW_FOCUS_GAINED : SDL_EVENT_WINDOW_FOCUS_LOST;
SDL_SendWindowEvent(window_data->window, sdl_event_type, 0, 0);
SDL_SetKeyboardFocus(sdl_event_type == SDL_EVENT_WINDOW_FOCUS_GAINED ? window_data->window : NULL);
return SDL_EventEnabled(sdl_event_type);
}