Don't send ready unless layer is ready to draw.

This commit is contained in:
Michael Jumper
2010-09-08 02:05:22 -07:00
parent 23ddb964b9
commit 71aef3f181
2 changed files with 10 additions and 0 deletions

View File

@@ -544,6 +544,12 @@ function VNCClient(display) {
function sendReady() { function sendReady() {
// If not ready, do not send ready
if (background == null || !background.isReady()) {
setTimeout(sendReady, 50);
return;
}
// Start heartbeat signal // Start heartbeat signal
var heartbeat = new XMLHttpRequest(); var heartbeat = new XMLHttpRequest();
heartbeat.open("GET", "ready"); heartbeat.open("GET", "ready");

View File

@@ -122,6 +122,10 @@ function Layer(width, height) {
}; };
display.isReady = function() {
return nextUpdateToDraw >= currentUpdate;
}
return display; return display;
} }