Skip to content

Commit

Permalink
debt - remove now obsolete smoothScrollingWorkaround setting
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Oct 15, 2018
1 parent db0dd58 commit d4dbfa3
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 45 deletions.
28 changes: 0 additions & 28 deletions src/vs/code/electron-main/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<IWindowSettings>('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 {
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/contrib/suggest/suggestMemory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
1 change: 0 additions & 1 deletion src/vs/platform/windows/common/windows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ export interface IWindowSettings {
nativeTabs: boolean;
enableMenuBarMnemonics: boolean;
closeWhenEmpty: boolean;
smoothScrollingWorkaround: boolean;
clickThroughInactive: boolean;
}

Expand Down
7 changes: 0 additions & 7 deletions src/vs/workbench/electron-browser/main.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit d4dbfa3

Please sign in to comment.