From a78a7bf8aa0d8d321a8d17fe547c0b01f28197bf Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Mon, 13 Dec 2021 10:03:28 +0100 Subject: [PATCH] Update comment for scrollbar workaround This is no longer an issue on Google Chrome, tested on Chrome 96 on Fedora 34, Windows 10, macOS 12 and Android 12. It is however an issue on Safari on macOS 12. Without this workaround we get scrollbars when making the browser window smaller, despite remote resize being enabled. --- core/rfb.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/rfb.js b/core/rfb.js index 15831033..fe9939f0 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -703,12 +703,13 @@ export default class RFB extends EventTargetMixin { } _fixScrollbars() { - // This is a hack because Chrome screws up the calculation - // for when scrollbars are needed. So to fix it we temporarily - // toggle them off and on. + // This is a hack because Safari on macOS screws up the calculation + // for when scrollbars are needed. We get scrollbars when making the + // browser smaller, despite remote resize being enabled. So to fix it + // we temporarily toggle them off and on. const orig = this._screen.style.overflow; this._screen.style.overflow = 'hidden'; - // Force Chrome to recalculate the layout by asking for + // Force Safari to recalculate the layout by asking for // an element's dimensions this._screen.getBoundingClientRect(); this._screen.style.overflow = orig;