fixed some errors in the logic from my last commit, also some minor indentation fixes
This commit is contained in:
parent
0bb4537529
commit
b0871c124e
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* noVNC: HTML5 VNC client
|
||||
* Copyright (C) 2012 Joel Martin
|
||||
* Copyright (C) 2013 Samuel Mannehed for Cendio AB
|
||||
* Licensed under MPL 2.0 (see LICENSE.txt)
|
||||
*
|
||||
* See README.md for usage and integration instructions.
|
||||
|
|
@ -1594,34 +1595,37 @@ encHandlers.ext_desktop_size = function () {
|
|||
//Util.Debug(">> ext_desktop_size");
|
||||
if (ws.rQwait("ext_desktop_size", 4)) { return false; }
|
||||
|
||||
supportsSetDesktopSize = true;
|
||||
|
||||
var number_of_screens = ws.rQshift8();
|
||||
|
||||
ws.rQshift8(); // padding
|
||||
ws.rQshift16(); // padding
|
||||
|
||||
for (var i=0; i<number_of_screens; i += 1) {
|
||||
screen_id = ws.rQshift32(); // id
|
||||
ws.rQshift16(); // x-position
|
||||
ws.rQshift16(); // y-position
|
||||
ws.rQshift16(); // width
|
||||
ws.rQshift16(); // height
|
||||
screen_flags = ws.rQshift32(); // flags
|
||||
}
|
||||
|
||||
if (FBU.x == 0) {
|
||||
fb_width = FBU.width;
|
||||
fb_height = FBU.height;
|
||||
conf.onFBResize(that, fb_width, fb_height);
|
||||
display.resize(fb_width, fb_height);
|
||||
timing.fbu_rt_start = (new Date()).getTime();
|
||||
// Send a new non-incremental request
|
||||
ws.send(fbUpdateRequests());
|
||||
|
||||
if (FBU.y == 0) {
|
||||
supportsSetDesktopSize = true;
|
||||
// Save the id and flags of the first screen
|
||||
if (i == 0) {
|
||||
screen_id = ws.rQshift32(); // id
|
||||
ws.rQshift16(); // x-position
|
||||
ws.rQshift16(); // y-position
|
||||
ws.rQshift16(); // width
|
||||
ws.rQshift16(); // height
|
||||
screen_flags = ws.rQshift32(); // flags
|
||||
} else {
|
||||
ws.rQshiftBytes(16);
|
||||
}
|
||||
}
|
||||
|
||||
if (FBU.x == 0 && FBU.y != 0) { return false; }
|
||||
|
||||
fb_width = FBU.width;
|
||||
fb_height = FBU.height;
|
||||
conf.onFBResize(that, fb_width, fb_height);
|
||||
display.resize(fb_width, fb_height);
|
||||
timing.fbu_rt_start = (new Date()).getTime();
|
||||
// Send a new non-incremental request
|
||||
ws.send(fbUpdateRequests());
|
||||
|
||||
FBU.bytes = 0;
|
||||
FBU.rects -= 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* noVNC: HTML5 VNC client
|
||||
* Copyright (C) 2012 Joel Martin
|
||||
* Copyright (C) 2013 Samuel Mannehed for Cendio AB
|
||||
* Licensed under MPL 2.0 (see LICENSE.txt)
|
||||
*
|
||||
* See README.md for usage and integration instructions.
|
||||
|
|
@ -39,10 +40,10 @@ load: function (callback) {
|
|||
onresize: function (callback) {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function(){
|
||||
// Control-bar height: 44px +
|
||||
// Status-bar height: 24px +
|
||||
// border height: 5px = 73px to be deducted from the height
|
||||
UI.rfb.setDesktopSize(window.innerWidth, window.innerHeight - 73);
|
||||
// Control-bar height: 44px +
|
||||
// Status-bar height: 24px +
|
||||
// border height: 5px = 73px to be deducted from the height
|
||||
UI.rfb.setDesktopSize(window.innerWidth, window.innerHeight - 73);
|
||||
}, 500);
|
||||
},
|
||||
|
||||
|
|
@ -465,7 +466,7 @@ updateState: function(rfb, state, oldstate, msg) {
|
|||
// When reconnecting to an existing session,
|
||||
// make sure the resolution is updated to the window size
|
||||
if (oldstate === 'ServerInitialisation') {
|
||||
onresize();
|
||||
onresize();
|
||||
}
|
||||
klass = "noVNC_status_normal";
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue