Merge pull request #25302 from eska014/html5-startupfs
Allow requesting full screen during start-up in HTML5 platform
This commit is contained in:
commit
a7525b5c13
1 changed files with 14 additions and 1 deletions
|
@ -861,8 +861,21 @@ Error OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver,
|
|||
video_driver_index = p_video_driver;
|
||||
|
||||
video_mode = p_desired;
|
||||
// Can't fulfill fullscreen request during start-up due to browser security.
|
||||
// fullscreen_change_callback will correct this if the request is successful.
|
||||
video_mode.fullscreen = false;
|
||||
// Emscripten only attempts fullscreen requests if the user input callback
|
||||
// was registered through one its own functions, so request manually for
|
||||
// start-up fullscreen.
|
||||
if (p_desired.fullscreen) {
|
||||
/* clang-format off */
|
||||
EM_ASM({
|
||||
(canvas.requestFullscreen || canvas.msRequestFullscreen ||
|
||||
canvas.mozRequestFullScreen || canvas.mozRequestFullscreen ||
|
||||
canvas.webkitRequestFullscreen
|
||||
).call(canvas);
|
||||
});
|
||||
/* clang-format on */
|
||||
}
|
||||
/* clang-format off */
|
||||
if (EM_ASM_INT_V({ return Module.resizeCanvasOnStart })) {
|
||||
/* clang-format on */
|
||||
|
|
Loading…
Reference in a new issue