From a9355e5e7a458bc82fc5d4a682a50f74ad17e48f Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Thu, 18 Oct 2018 18:13:12 +0200 Subject: [PATCH] Revert "remove layout trasher which seems unnecessary, #60031" This reverts commit 9ac1a920081ef247f14d275cad010ac7cfc47cdd. --- src/vs/workbench/browser/layout.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index 34c0b5ae2ba..7e85a0ee3e7 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -557,6 +557,15 @@ export class WorkbenchLayout extends Disposable implements IVerticalSashLayoutPr position(this.workbenchContainer, 0, 0, 0, 0, 'relative'); size(this.workbenchContainer, this.workbenchSize.width, this.workbenchSize.height); + // Bug on Chrome: Sometimes Chrome wants to scroll the workbench container on layout changes. The fix is to reset scrolling in this case. + const workbenchContainer = this.workbenchContainer; + if (workbenchContainer.scrollTop > 0) { + workbenchContainer.scrollTop = 0; + } + if (workbenchContainer.scrollLeft > 0) { + workbenchContainer.scrollLeft = 0; + } + // Title Part const titleContainer = this.parts.titlebar.getContainer(); if (isTitlebarHidden) { -- GitLab