diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-09-12 12:19:33 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-10-05 14:15:07 +0200 |
commit | b6315afc9ae89d12bcb6201b627605d630d58e58 (patch) | |
tree | 1b4bd16c0336258118c3a77344f8db42a1b52cb0 /platform/javascript/js/libs | |
parent | b2d30c725df3cb04f8a5b93455da13f5945d8b4d (diff) |
[HTML5] Implement fullscreenchange in JS library.
Removes more emscripten HTML5 library dependencies.
Diffstat (limited to 'platform/javascript/js/libs')
-rw-r--r-- | platform/javascript/js/libs/library_godot_display.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/platform/javascript/js/libs/library_godot_display.js b/platform/javascript/js/libs/library_godot_display.js index 0ad52a690f..435e5d89c8 100644 --- a/platform/javascript/js/libs/library_godot_display.js +++ b/platform/javascript/js/libs/library_godot_display.js @@ -853,6 +853,20 @@ const GodotDisplay = { /* * Listeners */ + godot_js_display_fullscreen_cb__sig: 'vi', + godot_js_display_fullscreen_cb: function (callback) { + const canvas = GodotConfig.canvas; + const func = GodotRuntime.get_func(callback); + function change_cb(evt) { + if (evt.target === canvas) { + func(GodotDisplayScreen.isFullscreen()); + } + } + GodotDisplayListeners.add(document, 'fullscreenchange', change_cb, false); + GodotDisplayListeners.add(document, 'mozfullscreenchange', change_cb, false); + GodotDisplayListeners.add(document, 'webkitfullscreenchange', change_cb, false); + }, + godot_js_display_notification_cb__sig: 'viiiii', godot_js_display_notification_cb: function (callback, p_enter, p_exit, p_in, p_out) { const canvas = GodotConfig.canvas; |