mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-01 02:56:43 +01:00
emscripten: Listen to "blur" instead of "visibilitychange" event to react to focus change
This commit is contained in:
parent
92d9f1c1bf
commit
8b9c9e5541
1 changed files with 2 additions and 2 deletions
|
@ -500,7 +500,7 @@ SYMBOL_INTERNAL void libsuperderpy_emscripten_mainloop(void* game) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SYMBOL_INTERNAL EM_BOOL libsuperderpy_emscripten_visibility_change(int eventType, const EmscriptenVisibilityChangeEvent* visibilityChangeEvent, void* game) {
|
SYMBOL_INTERNAL EM_BOOL libsuperderpy_emscripten_focus_change(int eventType, const EmscriptenFocusEvent* focusEvent, void* game) {
|
||||||
libsuperderpy_emscripten_mainloop(game);
|
libsuperderpy_emscripten_mainloop(game);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -513,7 +513,7 @@ SYMBOL_EXPORT int libsuperderpy_run(struct Game* game) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
emscripten_set_visibilitychange_callback(game, false, libsuperderpy_emscripten_visibility_change);
|
emscripten_set_blur_callback(EMSCRIPTEN_EVENT_TARGET_DOCUMENT, game, false, libsuperderpy_emscripten_focus_change);
|
||||||
emscripten_set_main_loop_arg(libsuperderpy_emscripten_mainloop, game, 0, true);
|
emscripten_set_main_loop_arg(libsuperderpy_emscripten_mainloop, game, 0, true);
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue