1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 10:39:25 +02:00

Send latest screen size with every update.

This commit is contained in:
Simo Kinnunen 2015-09-14 19:35:53 +09:00
parent 797e97e7c7
commit 692c043f6e
2 changed files with 18 additions and 8 deletions

View file

@ -90,14 +90,21 @@ module.exports = syrup.serial()
}
var decoded = jpeg.decode(connState.lastFrame)
conn.writeFramebufferUpdate([{
xPosition: 0
conn.writeFramebufferUpdate([
{ xPosition: 0
, yPosition: 0
, width: connState.frameWidth
, height: connState.frameHeight
, 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

View file

@ -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))