fixed some errors in the logic from my last commit, also some minor indentation fixes

This commit is contained in:
Samuel Mannehed 2013-06-25 13:10:39 +02:00
parent 0bb4537529
commit b0871c124e
2 changed files with 29 additions and 24 deletions

View File

@ -1,6 +1,7 @@
/* /*
* noVNC: HTML5 VNC client * noVNC: HTML5 VNC client
* Copyright (C) 2012 Joel Martin * Copyright (C) 2012 Joel Martin
* Copyright (C) 2013 Samuel Mannehed for Cendio AB
* Licensed under MPL 2.0 (see LICENSE.txt) * Licensed under MPL 2.0 (see LICENSE.txt)
* *
* See README.md for usage and integration instructions. * See README.md for usage and integration instructions.
@ -1594,21 +1595,29 @@ encHandlers.ext_desktop_size = function () {
//Util.Debug(">> ext_desktop_size"); //Util.Debug(">> ext_desktop_size");
if (ws.rQwait("ext_desktop_size", 4)) { return false; } if (ws.rQwait("ext_desktop_size", 4)) { return false; }
supportsSetDesktopSize = true;
var number_of_screens = ws.rQshift8(); var number_of_screens = ws.rQshift8();
ws.rQshift8(); // padding ws.rQshift8(); // padding
ws.rQshift16(); // padding ws.rQshift16(); // padding
for (var i=0; i<number_of_screens; i += 1) { for (var i=0; i<number_of_screens; i += 1) {
// Save the id and flags of the first screen
if (i == 0) {
screen_id = ws.rQshift32(); // id screen_id = ws.rQshift32(); // id
ws.rQshift16(); // x-position ws.rQshift16(); // x-position
ws.rQshift16(); // y-position ws.rQshift16(); // y-position
ws.rQshift16(); // width ws.rQshift16(); // width
ws.rQshift16(); // height ws.rQshift16(); // height
screen_flags = ws.rQshift32(); // flags screen_flags = ws.rQshift32(); // flags
} else {
ws.rQshiftBytes(16);
}
} }
if (FBU.x == 0) { if (FBU.x == 0 && FBU.y != 0) { return false; }
fb_width = FBU.width; fb_width = FBU.width;
fb_height = FBU.height; fb_height = FBU.height;
conf.onFBResize(that, fb_width, fb_height); conf.onFBResize(that, fb_width, fb_height);
@ -1617,11 +1626,6 @@ encHandlers.ext_desktop_size = function () {
// Send a new non-incremental request // Send a new non-incremental request
ws.send(fbUpdateRequests()); ws.send(fbUpdateRequests());
if (FBU.y == 0) {
supportsSetDesktopSize = true;
}
}
FBU.bytes = 0; FBU.bytes = 0;
FBU.rects -= 1; FBU.rects -= 1;

View File

@ -1,6 +1,7 @@
/* /*
* noVNC: HTML5 VNC client * noVNC: HTML5 VNC client
* Copyright (C) 2012 Joel Martin * Copyright (C) 2012 Joel Martin
* Copyright (C) 2013 Samuel Mannehed for Cendio AB
* Licensed under MPL 2.0 (see LICENSE.txt) * Licensed under MPL 2.0 (see LICENSE.txt)
* *
* See README.md for usage and integration instructions. * See README.md for usage and integration instructions.