From b6315afc9ae89d12bcb6201b627605d630d58e58 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Sun, 12 Sep 2021 12:19:33 +0200 Subject: [HTML5] Implement fullscreenchange in JS library. Removes more emscripten HTML5 library dependencies. --- platform/javascript/js/libs/library_godot_display.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'platform/javascript/js/libs') 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; -- cgit v1.2.3