From 45cedea78fc5f05b32c8514132349710707081b7 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Sun, 4 Jun 2023 14:55:35 +0200 Subject: [PATCH] Don't send SetDesktopSize too early We don't know the server layout yet, so we can't preserve the screen id or flags yet at this point. Move it until after we've parsed everything. --- core/rfb.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/rfb.js b/core/rfb.js index d89f029a..6857ed71 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -2726,14 +2726,6 @@ export default class RFB extends EventTargetMixin { const firstUpdate = !this._supportsSetDesktopSize; this._supportsSetDesktopSize = true; - // Normally we only apply the current resize mode after a - // window resize event. However there is no such trigger on the - // initial connect. And we don't know if the server supports - // resizing until we've gotten here. - if (firstUpdate) { - this._requestRemoteResize(); - } - this._sock.rQskipBytes(1); // number-of-screens this._sock.rQskipBytes(3); // padding @@ -2783,6 +2775,14 @@ export default class RFB extends EventTargetMixin { this._resize(this._FBU.width, this._FBU.height); } + // Normally we only apply the current resize mode after a + // window resize event. However there is no such trigger on the + // initial connect. And we don't know if the server supports + // resizing until we've gotten here. + if (firstUpdate) { + this._requestRemoteResize(); + } + return true; }