@@ -9,13 +9,12 @@ import * as errors from 'vs/base/common/errors';
99import { equals , deepClone , assign } from 'vs/base/common/objects' ;
1010import * as DOM from 'vs/base/browser/dom' ;
1111import { Separator } from 'vs/base/browser/ui/actionbar/actionbar' ;
12- import { IAction , Action } from 'vs/base/common/actions' ;
12+ import { IAction } from 'vs/base/common/actions' ;
1313import { IFileService } from 'vs/platform/files/common/files' ;
1414import { toResource , IUntitledResourceInput , SideBySideEditor , pathsToEditors } from 'vs/workbench/common/editor' ;
1515import { IEditorService , IResourceEditor } from 'vs/workbench/services/editor/common/editorService' ;
1616import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
1717import { IWindowSettings , IOpenFileRequest , IWindowsConfiguration , IAddFoldersRequest , IRunActionInWindowRequest , IRunKeybindingInWindowRequest , getTitleBarStyle } from 'vs/platform/windows/common/windows' ;
18- import { IContextMenuService } from 'vs/platform/contextview/browser/contextView' ;
1918import { ITitleService } from 'vs/workbench/services/title/common/titleService' ;
2019import { IWorkbenchThemeService , VS_HC_THEME } from 'vs/workbench/services/themes/common/workbenchThemeService' ;
2120import * as browser from 'vs/base/browser/browser' ;
@@ -62,17 +61,6 @@ import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/bro
6261import { IHostService } from 'vs/workbench/services/host/browser/host' ;
6362import { IElectronEnvironmentService } from 'vs/workbench/services/electron/electron-browser/electronEnvironmentService' ;
6463
65- const TextInputActions : IAction [ ] = [
66- new Action ( 'undo' , nls . localize ( 'undo' , "Undo" ) , undefined , true , ( ) => Promise . resolve ( document . execCommand ( 'undo' ) ) ) ,
67- new Action ( 'redo' , nls . localize ( 'redo' , "Redo" ) , undefined , true , ( ) => Promise . resolve ( document . execCommand ( 'redo' ) ) ) ,
68- new Separator ( ) ,
69- new Action ( 'editor.action.clipboardCutAction' , nls . localize ( 'cut' , "Cut" ) , undefined , true , ( ) => Promise . resolve ( document . execCommand ( 'cut' ) ) ) ,
70- new Action ( 'editor.action.clipboardCopyAction' , nls . localize ( 'copy' , "Copy" ) , undefined , true , ( ) => Promise . resolve ( document . execCommand ( 'copy' ) ) ) ,
71- new Action ( 'editor.action.clipboardPasteAction' , nls . localize ( 'paste' , "Paste" ) , undefined , true , ( ) => Promise . resolve ( document . execCommand ( 'paste' ) ) ) ,
72- new Separator ( ) ,
73- new Action ( 'editor.action.selectAll' , nls . localize ( 'selectAll' , "Select All" ) , undefined , true , ( ) => Promise . resolve ( document . execCommand ( 'selectAll' ) ) )
74- ] ;
75-
7664export class ElectronWindow extends Disposable {
7765
7866 private touchBarMenu : IMenu | undefined ;
@@ -96,7 +84,6 @@ export class ElectronWindow extends Disposable {
9684 @INotificationService private readonly notificationService : INotificationService ,
9785 @ICommandService private readonly commandService : ICommandService ,
9886 @IKeybindingService private readonly keybindingService : IKeybindingService ,
99- @IContextMenuService private readonly contextMenuService : IContextMenuService ,
10087 @ITelemetryService private readonly telemetryService : ITelemetryService ,
10188 @IWorkspaceEditingService private readonly workspaceEditingService : IWorkspaceEditingService ,
10289 @IFileService private readonly fileService : IFileService ,
@@ -239,9 +226,6 @@ export class ElectronWindow extends Disposable {
239226 }
240227 } ) ) ;
241228
242- // Context menu support in input/textarea
243- window . document . addEventListener ( 'contextmenu' , e => this . onContextMenu ( e ) ) ;
244-
245229 // Listen to visible editor changes
246230 this . _register ( this . editorService . onDidVisibleEditorsChange ( ( ) => this . onDidVisibleEditorsChange ( ) ) ) ;
247231
@@ -300,21 +284,6 @@ export class ElectronWindow extends Disposable {
300284 }
301285 }
302286
303- private onContextMenu ( e : MouseEvent ) : void {
304- if ( e . target instanceof HTMLElement ) {
305- const target = < HTMLElement > e . target ;
306- if ( target . nodeName && ( target . nodeName . toLowerCase ( ) === 'input' || target . nodeName . toLowerCase ( ) === 'textarea' ) ) {
307- DOM . EventHelper . stop ( e , true ) ;
308-
309- this . contextMenuService . showContextMenu ( {
310- getAnchor : ( ) => e ,
311- getActions : ( ) => TextInputActions ,
312- onHide : ( ) => target . focus ( ) // fixes https://github.com/Microsoft/vscode/issues/52948
313- } ) ;
314- }
315- }
316- }
317-
318287 private updateWindowZoomLevel ( ) : void {
319288 const windowConfig : IWindowsConfiguration = this . configurationService . getValue < IWindowsConfiguration > ( ) ;
320289
0 commit comments