[HTML5] Handle contextmenu, webglcontextlost internally.

This way they are automatically cleaned up when the engine exits,
landing a hand to browsers garbage collectors.
This commit is contained in:
Fabio Alessandrelli 2021-02-10 16:22:48 +01:00
parent e9e2dedb76
commit 3366122e1a
4 changed files with 16 additions and 11 deletions

View file

@ -703,6 +703,9 @@ DisplayServerJavaScript::DisplayServerJavaScript(const String &p_rendering_drive
// Ensure the canvas ID.
godot_js_config_canvas_id_get(canvas_id, 256);
// Handle contextmenu, webglcontextlost
godot_js_display_setup_canvas();
// Check if it's windows.
swap_cancel_ok = godot_js_display_is_swap_ok_cancel() == 1;