fix: improve web runtime resolution and restore x11vnc ncache
This commit is contained in:
@@ -107,8 +107,27 @@
|
||||
}
|
||||
|
||||
function currentScreenParams() {
|
||||
const width = clamp(window.innerWidth || document.documentElement.clientWidth || 1280, 320, 7680);
|
||||
const height = clamp(window.innerHeight || document.documentElement.clientHeight || 720, 240, 4320);
|
||||
const screenWidth =
|
||||
window.screen && Number.isFinite(window.screen.width) && window.screen.width > 0
|
||||
? window.screen.width
|
||||
: null;
|
||||
const screenHeight =
|
||||
window.screen && Number.isFinite(window.screen.height) && window.screen.height > 0
|
||||
? window.screen.height
|
||||
: null;
|
||||
const viewportWidth =
|
||||
(window.visualViewport && window.visualViewport.width) ||
|
||||
window.innerWidth ||
|
||||
document.documentElement.clientWidth ||
|
||||
1280;
|
||||
const viewportHeight =
|
||||
(window.visualViewport && window.visualViewport.height) ||
|
||||
window.innerHeight ||
|
||||
document.documentElement.clientHeight ||
|
||||
720;
|
||||
// Prefer stable screen dimensions; viewport is fallback.
|
||||
const width = clamp(Math.round(screenWidth || viewportWidth), 320, 7680);
|
||||
const height = clamp(Math.round(screenHeight || viewportHeight), 240, 4320);
|
||||
const sp = new URLSearchParams();
|
||||
sp.set('sw', String(width));
|
||||
sp.set('sh', String(height));
|
||||
|
||||
Reference in New Issue
Block a user