Skip to content

Commit 3976e53

Browse files
author
Benjamin Pasero
committed
remove swipeToNavigate (microsoft#57629)
1 parent 2ea7d60 commit 3976e53

4 files changed

Lines changed: 1 addition & 41 deletions

File tree

src/vs/code/electron-main/window.ts

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { ILogService } from 'vs/platform/log/common/log';
1313
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
1414
import { parseArgs } from 'vs/platform/environment/node/argv';
1515
import product from 'vs/platform/product/node/product';
16-
import { IWindowSettings, MenuBarVisibility, IWindowConfiguration, ReadyState, IRunActionInWindowRequest, getTitleBarStyle } from 'vs/platform/windows/common/windows';
16+
import { IWindowSettings, MenuBarVisibility, IWindowConfiguration, ReadyState, getTitleBarStyle } from 'vs/platform/windows/common/windows';
1717
import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
1818
import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform';
1919
import { ICodeWindow, IWindowState, WindowMode } from 'vs/platform/windows/electron-main/windows';
@@ -40,14 +40,6 @@ export const defaultWindowState = function (mode = WindowMode.Normal): IWindowSt
4040
};
4141
};
4242

43-
interface IWorkbenchEditorConfiguration {
44-
workbench: {
45-
editor: {
46-
swipeToNavigate: boolean
47-
}
48-
};
49-
}
50-
5143
interface ITouchBarSegment extends Electron.SegmentedControlSegment {
5244
id: string;
5345
}
@@ -460,30 +452,6 @@ export class CodeWindow extends Disposable implements ICodeWindow {
460452
this.currentMenuBarVisibility = newMenuBarVisibility;
461453
this.setMenuBarVisibility(newMenuBarVisibility);
462454
}
463-
464-
// Swipe command support (macOS)
465-
if (isMacintosh) {
466-
const config = this.configurationService.getValue<IWorkbenchEditorConfiguration>();
467-
if (config && config.workbench && config.workbench.editor && config.workbench.editor.swipeToNavigate) {
468-
this.registerSwipeListener();
469-
} else {
470-
this._win.removeAllListeners('swipe');
471-
}
472-
}
473-
}
474-
475-
private registerSwipeListener() {
476-
this._win.on('swipe', (event: Electron.Event, cmd: string) => {
477-
if (!this.isReady) {
478-
return; // window must be ready
479-
}
480-
481-
if (cmd === 'left') {
482-
this.send('vscode:runAction', { id: 'workbench.action.openPreviousRecentlyUsedEditor', from: 'mouse' } as IRunActionInWindowRequest);
483-
} else if (cmd === 'right') {
484-
this.send('vscode:runAction', { id: 'workbench.action.openNextRecentlyUsedEditor', from: 'mouse' } as IRunActionInWindowRequest);
485-
}
486-
});
487455
}
488456

489457
addTabbedWindow(window: ICodeWindow): void {

src/vs/platform/telemetry/common/telemetryUtils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ const configurationValueWhitelist = [
185185
'workbench.editor.enablePreviewFromQuickOpen',
186186
'workbench.editor.showTabs',
187187
'workbench.editor.highlightModifiedTabs',
188-
'workbench.editor.swipeToNavigate',
189188
'workbench.sideBar.location',
190189
'workbench.startupEditor',
191190
'workbench.statusBar.visible',

src/vs/workbench/browser/workbench.contribution.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,6 @@ import { isMacintosh, isWindows, isLinux, isWeb } from 'vs/base/common/platform'
107107
'description': nls.localize('revealIfOpen', "Controls whether an editor is revealed in any of the visible groups if opened. If disabled, an editor will prefer to open in the currently active editor group. If enabled, an already opened editor will be revealed instead of opened again in the currently active editor group. Note that there are some cases where this setting is ignored, e.g. when forcing an editor to open in a specific group or to the side of the currently active group."),
108108
'default': false
109109
},
110-
'workbench.editor.swipeToNavigate': {
111-
'type': 'boolean',
112-
'description': nls.localize('swipeToNavigate', "Navigate between open files using three-finger swipe horizontally."),
113-
'default': false,
114-
'included': isMacintosh && !isWeb
115-
},
116110
'workbench.editor.mouseBackForwardToNavigate': {
117111
'type': 'boolean',
118112
'description': nls.localize('mouseBackForwardToNavigate', "Navigate between open files using mouse buttons four and five if provided."),

src/vs/workbench/common/editor.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,6 @@ interface IEditorPartConfiguration {
986986
openSideBySideDirection?: 'right' | 'down';
987987
closeEmptyGroups?: boolean;
988988
revealIfOpen?: boolean;
989-
swipeToNavigate?: boolean;
990989
mouseBackForwardToNavigate?: boolean;
991990
labelFormat?: 'default' | 'short' | 'medium' | 'long';
992991
restoreViewState?: boolean;

0 commit comments

Comments
 (0)