KASM-5563 limit secondary screen rect buffer size (#95)

Co-authored-by: mattmcclaskey <matt@kasmweb.com>
This commit is contained in:
Matt McClaskey 2024-02-01 18:23:50 -05:00 committed by GitHub
parent 7919f6c750
commit 933d5b7505
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -899,6 +899,11 @@ export default class Display {
break;
}
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();
}
break;
case 'frameComplete':
window.requestAnimationFrame( () => { this._pushSyncRects(); });