mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-03-04 01:01:28 +01:00
emscripten: Attach the blur event to window, not document
Fixes blur event handling in Blink.
This commit is contained in:
parent
7f8e3b9641
commit
80044b91e3
1 changed files with 1 additions and 1 deletions
|
@ -513,7 +513,7 @@ SYMBOL_EXPORT int libsuperderpy_run(struct Game* game) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
emscripten_set_blur_callback(EMSCRIPTEN_EVENT_TARGET_DOCUMENT, game, false, libsuperderpy_emscripten_focus_change);
|
emscripten_set_blur_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, game, false, libsuperderpy_emscripten_focus_change);
|
||||||
if (game->config.autopause && !EM_ASM_INT({document.hasFocus()})) {
|
if (game->config.autopause && !EM_ASM_INT({document.hasFocus()})) {
|
||||||
PrintConsole(game, "Window not focused, autopausing...");
|
PrintConsole(game, "Window not focused, autopausing...");
|
||||||
PauseExecution(game);
|
PauseExecution(game);
|
||||||
|
|
Loading…
Add table
Reference in a new issue