diff --git a/os/web/index.sw.js b/os/web/index.sw.js index 3dbd51c1..82621055 100644 --- a/os/web/index.sw.js +++ b/os/web/index.sw.js @@ -44,7 +44,7 @@ const CACHE_FILES = [ "/", ]; -const VERSION = 129; +const VERSION = 130; const ENGINE_CACHE_NAME = "engine"; diff --git a/os/web/mainmenu.mjs b/os/web/mainmenu.mjs index b5ad701a..221450c0 100644 --- a/os/web/mainmenu.mjs +++ b/os/web/mainmenu.mjs @@ -647,18 +647,25 @@ function renderGameMenu(game, menuDiv, lang, hideWhenNoSaveGames) { const start = new Date(); const MAX_DELAY_MS = - window.location.hostname === "localhost" ? 1000 : 5000; + window.location.hostname === "localhost" ? 1000 : 3000; setStatusText("Waiting for fullscreen..."); while (new Date().getTime() - start.getTime() < MAX_DELAY_MS) { - if ( + const cssPixelDiff = Math.abs(screen.width - canvasParent.clientWidth) + - Math.abs( - screen.height - canvasParent.clientHeight - ) < - 1 - ) { + Math.abs(screen.height - canvasParent.clientHeight); + + if (cssPixelDiff < 1) { break; } + setStatusText( + `Waiting for fullscreen d=${cssPixelDiff} ` + + `screen=${screen.width}x${screen.height} ` + + `client=${canvasParent.clientWidth}x${canvasParent.clientHeight} ` + + `t=${ + MAX_DELAY_MS - + (new Date().getTime() - start.getTime()) + }ms` + ); await new Promise((r) => setTimeout(r, 10)); } setStatusText(null);