File tree Expand file tree Collapse file tree
src/vs/workbench/contrib/webview/browser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { URI } from 'vs/base/common/uri';
1414import { areWebviewInputOptionsEqual } from 'vs/workbench/contrib/webview/browser/webviewWorkbenchService' ;
1515import { WebviewThemeDataProvider } from 'vs/workbench/contrib/webview/common/themeing' ;
1616import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService' ;
17+ import { isLinux } from 'vs/base/common/platform' ;
1718
1819export const enum WebviewMessageChannels {
1920 onmessage = 'onmessage' ,
@@ -122,12 +123,15 @@ export abstract class BaseWebview<T extends HTMLElement> extends Disposable {
122123 this . handleFocusChange ( false ) ;
123124 } ) ) ;
124125
125- this . _register ( this . on ( 'did-keydown' , ( data : KeyboardEvent ) => {
126- // Electron: workaround for https://github.com/electron/electron/issues/14258
127- // We have to detect keyboard events in the <webview> and dispatch them to our
128- // keybinding service because these events do not bubble to the parent window anymore.
129- this . handleKeyDown ( data ) ;
130- } ) ) ;
126+ if ( ! isLinux ) {
127+ // Fixes #82670 webview responding shortcuts twice on linux.
128+ this . _register ( this . on ( 'did-keydown' , ( data : KeyboardEvent ) => {
129+ // Electron: workaround for https://github.com/electron/electron/issues/14258
130+ // We have to detect keyboard events in the <webview> and dispatch them to our
131+ // keybinding service because these events do not bubble to the parent window anymore.
132+ this . handleKeyDown ( data ) ;
133+ } ) ) ;
134+ }
131135
132136 this . style ( ) ;
133137 this . _register ( webviewThemeDataProvider . onThemeDataChanged ( this . style , this ) ) ;
You can’t perform that action at this time.
0 commit comments