From 0ac6c31ccfa00a1e893db542ba371f19fa0f61c3 Mon Sep 17 00:00:00 2001 From: samhed Date: Wed, 11 Sep 2013 10:49:25 +0200 Subject: [PATCH] Added the automatic resize functionality for vnc_auto.html. --- include/ui.js | 2 +- vnc_auto.html | 28 +++++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/include/ui.js b/include/ui.js index b24bd9c7..41c59e47 100644 --- a/include/ui.js +++ b/include/ui.js @@ -17,7 +17,7 @@ var resizeTimeout; window.onscriptsload = function () { UI.load(); }; window.onresize = function () { // When the window has been resized, wait until the size remains - // the same for 0.5 seconds before sending the request for changing + // the same for 0.5 seconds before sending the request for changing // the resolution of the session clearTimeout(resizeTimeout); resizeTimeout = setTimeout(function(){ diff --git a/vnc_auto.html b/vnc_auto.html index 2aa21889..d1f32f00 100644 --- a/vnc_auto.html +++ b/vnc_auto.html @@ -71,7 +71,18 @@ "input.js", "display.js", "jsunzip.js", "rfb.js"]); var rfb; + var resizeTimeout; + + function UIresize() { + // Control-bar height: 36px + + // border height: 5px = 41px to be deducted from the height + rfb.setDesktopSize(window.innerWidth, window.innerHeight - 41); + } + function FBUComplete(rfb, fbu) { + UIresize(); + rfb.set_onFBUComplete(function() { }); + } function passwordRequired(rfb) { var msg; msg = '