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