From b3e5d256a2f3ef66982990fe074239d058a706f0 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 25 Jan 2019 17:19:21 +0100 Subject: [PATCH] electron 3.0.x: remove window.smoothScrollingWorkaround setting --- src/main.js | 1 - src/vs/code/electron-main/window.ts | 28 ------------------- src/vs/platform/windows/common/windows.ts | 8 +----- .../electron-browser/shell.contribution.ts | 7 ----- .../relauncher.contribution.ts | 9 +----- 5 files changed, 2 insertions(+), 51 deletions(-) diff --git a/src/main.js b/src/main.js index b110c753ce5..5d6dcfca955 100644 --- a/src/main.js +++ b/src/main.js @@ -151,7 +151,6 @@ function onReady() { function configureCommandlineSwitches(cliArgs, nodeCachedDataDir) { // Force pre-Chrome-60 color profile handling (for https://github.com/Microsoft/vscode/issues/51791) - // TODO@Ben check if future versions of Electron still support this flag app.commandLine.appendSwitch('disable-features', 'ColorCorrectRendering'); // Support JS Flags diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index 2546f98ec5b..dbe19cc5743 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -424,34 +424,6 @@ export class CodeWindow extends Disposable implements ICodeWindow { // Handle Workspace events this._register(this.workspacesMainService.onUntitledWorkspaceDeleted(e => this.onUntitledWorkspaceDeleted(e))); - - // TODO@Ben workaround for https://github.com/Microsoft/vscode/issues/13612 - // It looks like smooth scrolling disappears as soon as the window is minimized - // and maximized again. Touching some window properties "fixes" it, like toggling - // the visibility of the menu. - if (isWindows) { - const windowConfig = this.configurationService.getValue('window'); - if (windowConfig && windowConfig.smoothScrollingWorkaround === true) { - let minimized = false; - - const restoreSmoothScrolling = () => { - if (minimized) { - const visibility = this.getMenuBarVisibility(); - const temporaryVisibility: MenuBarVisibility = (visibility === 'hidden' || visibility === 'toggle') ? 'default' : 'hidden'; - setTimeout(() => { - this.doSetMenuBarVisibility(temporaryVisibility); - this.doSetMenuBarVisibility(visibility); - }, 0); - } - - minimized = false; - }; - - this._win.on('minimize', () => minimized = true); - this._win.on('restore', () => restoreSmoothScrolling()); - this._win.on('maximize', () => restoreSmoothScrolling()); - } - } } private onUntitledWorkspaceDeleted(workspace: IWorkspaceIdentifier): void { diff --git a/src/vs/platform/windows/common/windows.ts b/src/vs/platform/windows/common/windows.ts index 649ef74160c..56eaeef6f49 100644 --- a/src/vs/platform/windows/common/windows.ts +++ b/src/vs/platform/windows/common/windows.ts @@ -6,7 +6,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { Event } from 'vs/base/common/event'; import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; -import { IProcessEnvironment, isMacintosh, isWindows } from 'vs/base/common/platform'; +import { IProcessEnvironment, isMacintosh } from 'vs/base/common/platform'; import { ParsedArgs, IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces'; import { IRecentlyOpened } from 'vs/platform/history/common/history'; @@ -247,7 +247,6 @@ export interface IWindowSettings { nativeFullScreen: boolean; enableMenuBarMnemonics: boolean; closeWhenEmpty: boolean; - smoothScrollingWorkaround: boolean; clickThroughInactive: boolean; } @@ -270,11 +269,6 @@ export function getTitleBarStyle(configurationService: IConfigurationService, en return 'native'; // simple fullscreen does not work well with custom title style (https://github.com/Microsoft/vscode/issues/63291) } - const smoothScrollingWorkaround = isWindows && configuration.smoothScrollingWorkaround === true; - if (smoothScrollingWorkaround) { - return 'native'; // smooth scrolling workaround does not work with custom title style - } - const style = configuration.titleBarStyle; if (style === 'native') { return 'native'; diff --git a/src/vs/workbench/electron-browser/shell.contribution.ts b/src/vs/workbench/electron-browser/shell.contribution.ts index 55877e94029..bc02c150a70 100644 --- a/src/vs/workbench/electron-browser/shell.contribution.ts +++ b/src/vs/workbench/electron-browser/shell.contribution.ts @@ -620,13 +620,6 @@ configurationRegistry.registerConfiguration({ 'description': nls.localize('window.nativeFullScreen', "Controls if native full-screen should be used on macOS. Disable this option to prevent macOS from creating a new space when going full-screen."), 'included': isMacintosh }, - 'window.smoothScrollingWorkaround': { // TODO@Ben remove once https://github.com/Microsoft/vscode/issues/61824 settles - 'type': 'boolean', - 'default': false, - 'scope': ConfigurationScope.APPLICATION, - 'markdownDescription': nls.localize('window.smoothScrollingWorkaround', "Enable this workaround if scrolling is no longer smooth after restoring a minimized VS Code window. This is a workaround for an issue (https://github.com/Microsoft/vscode/issues/13612) where scrolling starts to lag on devices with precision trackpads like the Surface devices from Microsoft. Enabling this workaround can result in a little bit of layout flickering after restoring the window from minimized state but is otherwise harmless."), - 'included': isWindows - }, 'window.clickThroughInactive': { 'type': 'boolean', 'default': true, diff --git a/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts b/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts index 0fee458eec6..64a3d5341d6 100644 --- a/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts +++ b/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts @@ -15,7 +15,7 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten import { RunOnceScheduler } from 'vs/base/common/async'; import { URI } from 'vs/base/common/uri'; import { isEqual } from 'vs/base/common/resources'; -import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; +import { isLinux, isMacintosh } from 'vs/base/common/platform'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { equals } from 'vs/base/common/objects'; @@ -38,7 +38,6 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo private enableCrashReporter: boolean; private touchbarEnabled: boolean; private treeHorizontalScrolling: boolean; - private windowsSmoothScrollingWorkaround: boolean; private experimentalFileWatcher: boolean; private fileWatcherExclude: object; private useGridLayout: boolean; @@ -139,12 +138,6 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo changed = true; } - // Windows: smooth scrolling workaround - if (isWindows && config.window && typeof config.window.smoothScrollingWorkaround === 'boolean' && config.window.smoothScrollingWorkaround !== this.windowsSmoothScrollingWorkaround) { - this.windowsSmoothScrollingWorkaround = config.window.smoothScrollingWorkaround; - changed = true; - } - // Workbench Grid Layout if (config.workbench && typeof config.workbench.useExperimentalGridLayout === 'boolean' && config.workbench.useExperimentalGridLayout !== this.useGridLayout) { this.useGridLayout = config.workbench.useExperimentalGridLayout;