From 599d9ba198a6c2f5a72574699fe6f41d6ec90f05 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 5 Jun 2017 21:30:25 -0400 Subject: [PATCH] emscripten: listen for pointerlockchange events on the #document specifically. --- src/video/emscripten/SDL_emscriptenevents.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/emscripten/SDL_emscriptenevents.c b/src/video/emscripten/SDL_emscriptenevents.c index 85f56f4d0..9b0d12a90 100644 --- a/src/video/emscripten/SDL_emscriptenevents.c +++ b/src/video/emscripten/SDL_emscriptenevents.c @@ -652,7 +652,7 @@ Emscripten_RegisterEventHandlers(SDL_WindowData *data) emscripten_set_touchmove_callback("#canvas", data, 0, Emscripten_HandleTouch); emscripten_set_touchcancel_callback("#canvas", data, 0, Emscripten_HandleTouch); - emscripten_set_pointerlockchange_callback(NULL, data, 0, Emscripten_HandlePointerLockChange); + emscripten_set_pointerlockchange_callback("#document", data, 0, Emscripten_HandlePointerLockChange); /* Keyboard events are awkward */ keyElement = SDL_GetHint(SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT); @@ -693,7 +693,7 @@ Emscripten_UnregisterEventHandlers(SDL_WindowData *data) emscripten_set_touchmove_callback("#canvas", NULL, 0, NULL); emscripten_set_touchcancel_callback("#canvas", NULL, 0, NULL); - emscripten_set_pointerlockchange_callback(NULL, NULL, 0, NULL); + emscripten_set_pointerlockchange_callback("#document", NULL, 0, NULL); target = SDL_GetHint(SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT); if (!target) {