Listen for blur and focus events on window instead of canvas
authorBoris Gjenero <boris.gjenero@gmail.com>
Tue, 13 Sep 2016 00:03:48 -0700
changeset 1032747d840cce014
parent 10326 b7059a6e0de7
child 10328 3e6cd603c977
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.
src/video/emscripten/SDL_emscriptenevents.c
     1.1 --- a/src/video/emscripten/SDL_emscriptenevents.c	Tue Sep 13 00:03:46 2016 -0700
     1.2 +++ b/src/video/emscripten/SDL_emscriptenevents.c	Tue Sep 13 00:03:48 2016 -0700
     1.3 @@ -586,8 +586,8 @@
     1.4  
     1.5      emscripten_set_wheel_callback("#canvas", data, 0, Emscripten_HandleWheel);
     1.6  
     1.7 -    emscripten_set_focus_callback("#canvas", data, 0, Emscripten_HandleFocus);
     1.8 -    emscripten_set_blur_callback("#canvas", data, 0, Emscripten_HandleFocus);
     1.9 +    emscripten_set_focus_callback("#window", data, 0, Emscripten_HandleFocus);
    1.10 +    emscripten_set_blur_callback("#window", data, 0, Emscripten_HandleFocus);
    1.11  
    1.12      emscripten_set_touchstart_callback("#canvas", data, 0, Emscripten_HandleTouch);
    1.13      emscripten_set_touchend_callback("#canvas", data, 0, Emscripten_HandleTouch);
    1.14 @@ -623,8 +623,8 @@
    1.15  
    1.16      emscripten_set_wheel_callback("#canvas", NULL, 0, NULL);
    1.17  
    1.18 -    emscripten_set_focus_callback("#canvas", NULL, 0, NULL);
    1.19 -    emscripten_set_blur_callback("#canvas", NULL, 0, NULL);
    1.20 +    emscripten_set_focus_callback("#window", NULL, 0, NULL);
    1.21 +    emscripten_set_blur_callback("#window", NULL, 0, NULL);
    1.22  
    1.23      emscripten_set_touchstart_callback("#canvas", NULL, 0, NULL);
    1.24      emscripten_set_touchend_callback("#canvas", NULL, 0, NULL);