diff --git a/include/display.js b/include/display.js index 8252ef83..ebad4641 100644 --- a/include/display.js +++ b/include/display.js @@ -590,7 +590,9 @@ that.drawImage = function(img, x, y) { that.renderQ_push = function(action) { renderQ.push(action); if (renderQ.length === 1) { - // Check if it can be rendered immediately + // If this can be rendered immediately it will be, otherwise + // the scanner will start polling the queue (every + // requestAnimationFrame interval) scan_renderQ(); } }; diff --git a/include/rfb.js b/include/rfb.js index f80d190e..4362ce14 100644 --- a/include/rfb.js +++ b/include/rfb.js @@ -1109,9 +1109,14 @@ encHandlers.COPYRECT = function display_copy_rect() { var old_x, old_y; if (ws.rQwait("COPYRECT", 4)) { return false; } - old_x = ws.rQshift16(); - old_y = ws.rQshift16(); - display.copyImage(old_x, old_y, FBU.x, FBU.y, FBU.width, FBU.height); + display.renderQ_push({ + 'type': 'copy', + 'old_x': ws.rQshift16(), + 'old_y': ws.rQshift16(), + 'x': FBU.x, + 'y': FBU.y, + 'width': FBU.width, + 'height': FBU.height}); FBU.rects -= 1; FBU.bytes = 0; return true;