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 <matt@kasmweb.com>
This commit is contained in:
Matt McClaskey 2024-03-12 08:32:01 -04:00 committed by GitHub
parent bf7a417ab7
commit bbc685aa0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -910,8 +910,9 @@ export default class Display {
this._syncFrameQueue.push(rect); 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 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) { if (this._syncFrameQueue.length > 5000) {
this._syncFrameQueue.pop(); this._syncFrameQueue.shift();
this._droppedRects++;
} }
break; break;
case 'frameComplete': case 'frameComplete':
@ -953,7 +954,7 @@ export default class Display {
if (a.img.complete) { if (a.img.complete) {
this.drawImage(a.img, pos.x, pos.y, a.width, a.height); this.drawImage(a.img, pos.x, pos.y, a.width, a.height);
} else { } else {
if (this._syncFrameQueue.length > 1000) { if (this._syncFrameQueue.length > 5000) {
this._syncFrameQueue.shift(); this._syncFrameQueue.shift();
this._droppedRects++; this._droppedRects++;
} else { } else {