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.
This commit is contained in:
Samuel Mannehed 2021-12-13 10:03:28 +01:00
parent 78eda3c040
commit a78a7bf8aa
1 changed files with 5 additions and 4 deletions

View File

@ -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;