diff --git a/lib/units/device/plugins/vnc/index.js b/lib/units/device/plugins/vnc/index.js index 66581f3b..7593e962 100644 --- a/lib/units/device/plugins/vnc/index.js +++ b/lib/units/device/plugins/vnc/index.js @@ -90,14 +90,21 @@ module.exports = syrup.serial() } var decoded = jpeg.decode(connState.lastFrame) - conn.writeFramebufferUpdate([{ - xPosition: 0 - , yPosition: 0 - , width: connState.frameWidth - , height: connState.frameHeight - , encodingType: VncConnection.ENCODING_RAW - , data: decoded.data - }]) + conn.writeFramebufferUpdate([ + { xPosition: 0 + , yPosition: 0 + , width: decoded.width + , height: decoded.height + , encodingType: VncConnection.ENCODING_RAW + , data: decoded.data + } + , { xPosition: 0 + , yPosition: 0 + , width: decoded.width + , height: decoded.height + , encodingType: VncConnection.ENCODING_DESKTOPSIZE + } + ]) connState.updateRequests = 0 connState.sentFrameTime = connState.lastFrameTime diff --git a/lib/units/device/plugins/vnc/util/connection.js b/lib/units/device/plugins/vnc/util/connection.js index 80ac88e8..eeaf24ca 100644 --- a/lib/units/device/plugins/vnc/util/connection.js +++ b/lib/units/device/plugins/vnc/util/connection.js @@ -92,6 +92,7 @@ var StateReverse = Object.create(null), State = { } VncConnection.ENCODING_RAW = 0 +VncConnection.ENCODING_DESKTOPSIZE = -223 Object.keys(State).map(function(name) { VncConnection[name] = State[name] @@ -122,6 +123,8 @@ VncConnection.prototype.writeFramebufferUpdate = function(rectangles) { case VncConnection.ENCODING_RAW: this._write(rect.data) break + case VncConnection.ENCODING_DESKTOPSIZE: + break default: throw new Error(util.format( 'Unsupported encoding type', rect.encodingType))