提交 f37faf6c 编写于 作者: M Matt Bierner

Fix double paste in webvies

Fixes #101946

This is a more scoped fix for #101946. It disable the VS Code triggered events (undo, copy, paste, ...) for webviews if you are on a platform that uses custom title bars
上级 ecd1c92c
......@@ -15,6 +15,8 @@ import { getActiveWebview } from 'vs/workbench/contrib/webview/browser/webviewCo
import * as webviewCommands from 'vs/workbench/contrib/webview/electron-browser/webviewCommands';
import { ElectronWebviewBasedWebview } from 'vs/workbench/contrib/webview/electron-browser/webviewElement';
import { ElectronWebviewService } from 'vs/workbench/contrib/webview/electron-browser/webviewService';
import { isMacintosh } from 'vs/base/common/platform';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
registerSingleton(IWebviewService, ElectronWebviewService, true);
......@@ -52,6 +54,10 @@ const PRIORITY = 100;
function overrideCommandForWebview(command: MultiCommand | undefined, f: (webview: ElectronWebviewBasedWebview) => void) {
command?.addImplementation(PRIORITY, accessor => {
if (!isMacintosh || accessor.get(IConfigurationService).getValue<string>('window.titleBarStyle') !== 'native') {
return false;
}
const webview = getActiveElectronBasedWebview(accessor);
if (webview) {
f(webview);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册