Listen for blur and focus events on window instead of canvas

Blur and focus events were not arriving for the canvas in
Firefox 35 and Chrome 40.
Boris Gjenero 2016-09-13 00:03:48 -07:00
parent 3e5c4cec94
commit a0a75f384f
1 changed files with 4 additions and 4 deletions

View File

@ -586,8 +586,8 @@ Emscripten_RegisterEventHandlers(SDL_WindowData *data)
emscripten_set_wheel_callback("#canvas", data, 0, Emscripten_HandleWheel); emscripten_set_wheel_callback("#canvas", data, 0, Emscripten_HandleWheel);
emscripten_set_focus_callback("#canvas", data, 0, Emscripten_HandleFocus); emscripten_set_focus_callback("#window", data, 0, Emscripten_HandleFocus);
emscripten_set_blur_callback("#canvas", data, 0, Emscripten_HandleFocus); emscripten_set_blur_callback("#window", data, 0, Emscripten_HandleFocus);
emscripten_set_touchstart_callback("#canvas", data, 0, Emscripten_HandleTouch); emscripten_set_touchstart_callback("#canvas", data, 0, Emscripten_HandleTouch);
emscripten_set_touchend_callback("#canvas", data, 0, Emscripten_HandleTouch); emscripten_set_touchend_callback("#canvas", data, 0, Emscripten_HandleTouch);
@ -623,8 +623,8 @@ Emscripten_UnregisterEventHandlers(SDL_WindowData *data)
emscripten_set_wheel_callback("#canvas", NULL, 0, NULL); emscripten_set_wheel_callback("#canvas", NULL, 0, NULL);
emscripten_set_focus_callback("#canvas", NULL, 0, NULL); emscripten_set_focus_callback("#window", NULL, 0, NULL);
emscripten_set_blur_callback("#canvas", NULL, 0, NULL); emscripten_set_blur_callback("#window", NULL, 0, NULL);
emscripten_set_touchstart_callback("#canvas", NULL, 0, NULL); emscripten_set_touchstart_callback("#canvas", NULL, 0, NULL);
emscripten_set_touchend_callback("#canvas", NULL, 0, NULL); emscripten_set_touchend_callback("#canvas", NULL, 0, NULL);