From bbc685aa0f470188b4b225c078c8b841da2da335 Mon Sep 17 00:00:00 2001 From: Matt McClaskey Date: Tue, 12 Mar 2024 08:32:01 -0400 Subject: [PATCH] KASM-5720 - Fix artifacts on secondary screens with high resolution (#104) * increase buffer size, track drops, change pop to shift * match rect limit elsewhere --------- Co-authored-by: mattmcclaskey --- core/display.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/display.js b/core/display.js index a4465641..6f7c87f2 100644 --- a/core/display.js +++ b/core/display.js @@ -910,8 +910,9 @@ export default class Display { this._syncFrameQueue.push(rect); //if the secondary display is not in focus, the browser may not call requestAnimationFrame, thus we need to limit our buffer - if (this._syncFrameQueue.length > 500) { - this._syncFrameQueue.pop(); + if (this._syncFrameQueue.length > 5000) { + this._syncFrameQueue.shift(); + this._droppedRects++; } break; case 'frameComplete': @@ -953,7 +954,7 @@ export default class Display { if (a.img.complete) { this.drawImage(a.img, pos.x, pos.y, a.width, a.height); } else { - if (this._syncFrameQueue.length > 1000) { + if (this._syncFrameQueue.length > 5000) { this._syncFrameQueue.shift(); this._droppedRects++; } else {