From cd05184f9b9859192f12bfdefdc8d6aa3e9053b6 Mon Sep 17 00:00:00 2001 From: Charlie Birks Date: Tue, 13 Sep 2016 00:03:36 -0700 Subject: [PATCH] use SDL_SetMouseFocus --- src/video/emscripten/SDL_emscriptenevents.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video/emscripten/SDL_emscriptenevents.c b/src/video/emscripten/SDL_emscriptenevents.c index 02a547826..ea5776b0c 100644 --- a/src/video/emscripten/SDL_emscriptenevents.c +++ b/src/video/emscripten/SDL_emscriptenevents.c @@ -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; }