Skip to content

Commit

Permalink
#1341: catch paint errors and report them to the server
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@14617 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Dec 27, 2016
1 parent ff836f5 commit ecb5fb3
Showing 1 changed file with 26 additions and 20 deletions.
46 changes: 26 additions & 20 deletions src/html5/js/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1501,29 +1501,35 @@ XpraClient.prototype._process_draw_queue = function(packet, ctx){
var win = ctx.id_to_window[wid];
var decode_time = -1;
if (win) {
win.paint(x, y,
width, height,
coding, data, packet_sequence, rowstride, options,
function (ctx) {
var flush = options["flush"] || 0;
if(flush==0) {
// request that drawing to screen takes place at next available opportunity if possible
if(requestAnimationFrame) {
requestAnimationFrame(function() {
try {
win.paint(x, y,
width, height,
coding, data, packet_sequence, rowstride, options,
function (ctx) {
var flush = options["flush"] || 0;
if(flush==0) {
// request that drawing to screen takes place at next available opportunity if possible
if(requestAnimationFrame) {
requestAnimationFrame(function() {
win.draw();
});
} else {
// requestAnimationFrame is not available, draw immediately
win.draw();
});
} else {
// requestAnimationFrame is not available, draw immediately
win.draw();
}
}
decode_time = new Date().getTime() - start;
if(ctx.debug) {
console.debug("decode time for ", coding, " sequence ", packet_sequence, ": ", decode_time);
}
ctx._window_send_damage_sequence(wid, packet_sequence, width, height, decode_time);
}
decode_time = new Date().getTime() - start;
if(ctx.debug) {
console.debug("decode time for ", coding, " sequence ", packet_sequence, ": ", decode_time);
}
ctx._window_send_damage_sequence(wid, packet_sequence, width, height, decode_time);
}
);
);
}
catch(e) {
ctx.error('error painting', coding, e);
ctx._window_send_damage_sequence(wid, packet_sequence, width, height, -1, String(e));
}
}
}

Expand Down

0 comments on commit ecb5fb3

Please sign in to comment.