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) var decoded = jpeg.decode(connState.lastFrame)
conn.writeFramebufferUpdate([{ conn.writeFramebufferUpdate([
xPosition: 0 { xPosition: 0
, yPosition: 0 , yPosition: 0
, width: connState.frameWidth , width: decoded.width
, height: connState.frameHeight , height: decoded.height
, encodingType: VncConnection.ENCODING_RAW , encodingType: VncConnection.ENCODING_RAW
, data: decoded.data , data: decoded.data
}]) }
, { xPosition: 0
, yPosition: 0
, width: decoded.width
, height: decoded.height
, encodingType: VncConnection.ENCODING_DESKTOPSIZE
}
])
connState.updateRequests = 0 connState.updateRequests = 0
connState.sentFrameTime = connState.lastFrameTime connState.sentFrameTime = connState.lastFrameTime

View file

@ -92,6 +92,7 @@ var StateReverse = Object.create(null), State = {
} }
VncConnection.ENCODING_RAW = 0 VncConnection.ENCODING_RAW = 0
VncConnection.ENCODING_DESKTOPSIZE = -223
Object.keys(State).map(function(name) { Object.keys(State).map(function(name) {
VncConnection[name] = State[name] VncConnection[name] = State[name]
@ -122,6 +123,8 @@ VncConnection.prototype.writeFramebufferUpdate = function(rectangles) {
case VncConnection.ENCODING_RAW: case VncConnection.ENCODING_RAW:
this._write(rect.data) this._write(rect.data)
break break
case VncConnection.ENCODING_DESKTOPSIZE:
break
default: default:
throw new Error(util.format( throw new Error(util.format(
'Unsupported encoding type', rect.encodingType)) 'Unsupported encoding type', rect.encodingType))