use SDL_SetMouseFocus

This commit is contained in:
Charlie Birks 2016-09-13 00:03:36 -07:00
parent bdca510fd6
commit cd05184f9b
1 changed files with 2 additions and 1 deletions

View File

@ -349,7 +349,8 @@ EM_BOOL
Emscripten_HandleMouseFocus(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData)
{
SDL_WindowData *window_data = userData;
SDL_SendWindowEvent(window_data->window, eventType == EMSCRIPTEN_EVENT_MOUSEENTER ? SDL_WINDOWEVENT_ENTER : SDL_WINDOWEVENT_LEAVE, 0, 0);
SDL_SetMouseFocus(eventType == EMSCRIPTEN_EVENT_MOUSEENTER ? window_data->window : NULL);
return 1;
}