From 29ad96c5261ab0a1ea4ec46601ad0e47418f4e75 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Thu, 29 Jul 2010 10:47:32 -0500 Subject: [PATCH] Give other events chance to fire. After each complete framebufferUpdate, set a short timer to continue processing the receive queue. This gives other events a chance to fire. Especially important when noVNC is integrated into another website. --- include/rfb.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/rfb.js b/include/rfb.js index fe92a778..fee6f271 100644 --- a/include/rfb.js +++ b/include/rfb.js @@ -1250,13 +1250,12 @@ handle_message: function () { RFB.disconnect(); break; case 'normal': - while ((RFB.state === 'normal') && (RFB.RQ.length > 0)) { + if ((RFB.state === 'normal') && (RFB.RQ.length > 0)) { if (RFB.normal_msg()) { // true means we can continue processing Util.Debug("More data to process"); - } else { - // false means we need more data - break; + // Give other events a chance to run + setTimeout(RFB.handle_message, 10); } } break;