From d4dbfa3c29909e537646b75e6d166714c5f86052 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 15 Oct 2018 18:54:31 +0200 Subject: [PATCH] debt - remove now obsolete smoothScrollingWorkaround setting --- src/vs/code/electron-main/window.ts | 28 ------------------- .../editor/contrib/suggest/suggestMemory.ts | 2 +- src/vs/platform/windows/common/windows.ts | 1 - .../electron-browser/main.contribution.ts | 7 ----- .../relauncher.contribution.ts | 9 +----- 5 files changed, 2 insertions(+), 45 deletions(-) diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index 95cd7498c280c..9ee3f1c5d1b02 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -408,34 +408,6 @@ export class CodeWindow implements ICodeWindow { // Handle Workspace events this.toDispose.push(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/editor/contrib/suggest/suggestMemory.ts b/src/vs/editor/contrib/suggest/suggestMemory.ts index bf2115b06ae10..1f92895395f2e 100644 --- a/src/vs/editor/contrib/suggest/suggestMemory.ts +++ b/src/vs/editor/contrib/suggest/suggestMemory.ts @@ -238,6 +238,6 @@ export class SuggestMemories extends Disposable { private _saveState() { const raw = JSON.stringify(this._strategy); - this._storageService.store(`${this._storagePrefix}/${this._mode}`, raw, StorageScope.WORKSPACE); // + this._storageService.store(`${this._storagePrefix}/${this._mode}`, raw, StorageScope.WORKSPACE); } } diff --git a/src/vs/platform/windows/common/windows.ts b/src/vs/platform/windows/common/windows.ts index 7f7bf02ec76b8..facb0567866b0 100644 --- a/src/vs/platform/windows/common/windows.ts +++ b/src/vs/platform/windows/common/windows.ts @@ -236,7 +236,6 @@ export interface IWindowSettings { nativeTabs: boolean; enableMenuBarMnemonics: boolean; closeWhenEmpty: boolean; - smoothScrollingWorkaround: boolean; clickThroughInactive: boolean; } diff --git a/src/vs/workbench/electron-browser/main.contribution.ts b/src/vs/workbench/electron-browser/main.contribution.ts index 0ca0c3f754e08..85834585bcbfb 100644 --- a/src/vs/workbench/electron-browser/main.contribution.ts +++ b/src/vs/workbench/electron-browser/main.contribution.ts @@ -818,13 +818,6 @@ configurationRegistry.registerConfiguration({ 'description': nls.localize('window.nativeTabs', "Enables macOS Sierra window tabs. Note that changes require a full restart to apply and that native tabs will disable a custom title bar style if configured."), 'included': isMacintosh && parseFloat(os.release()) >= 16 // Minimum: macOS Sierra (10.12.x = darwin 16.x) }, - 'window.smoothScrollingWorkaround': { - '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. Note: in order for this workaround to function, make sure to also set `#window.titleBarStyle#` to `native`."), - '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 fdd47397dc167..76c20e0769a19 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'; @@ -37,7 +37,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; @@ -131,12 +130,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; - } - // Notify only when changed and we are the focused window (avoids notification spam across windows) if (notify && changed) { this.doConfirm(