From cace921202fbdbf06d92c3d77b6200009c05e6ca Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 11 Mar 2011 19:43:13 -0800 Subject: [PATCH] Support for sync instruction --- .../src/main/resources/guacamole.js | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/guacamole-common-js/src/main/resources/guacamole.js b/guacamole-common-js/src/main/resources/guacamole.js index 0d35eaddf..e5956d801 100644 --- a/guacamole-common-js/src/main/resources/guacamole.js +++ b/guacamole-common-js/src/main/resources/guacamole.js @@ -307,7 +307,38 @@ function GuacamoleClient(display, tunnel) { }; image.src = "data:image/png;base64," + data - } + }, + + "sync": function(parameters) { + + var timestamp = parameters[0]; + + // When all layers have finished rendering all instructions + // UP TO THIS POINT IN TIME, send sync response. + + var layersToSync = 0; + function syncLayer() { + + layersToSync--; + + // Send sync response when layers are finished + if (layersToSync == 0) + tunnel.sendMessage("sync:" + timestamp + ";"); + + } + + // Count active layers and install sync tracking hook + for (var i=0; i