From 2b5ac23284a67cebc4a2d68354ccc544c5baa2c8 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 13 Jul 2020 10:56:15 -0700 Subject: [PATCH] Fix conditional for overrideCommandForWebview This command should be active if: - we are on mac - or we are not using custom title bars The previous code was incorrectly disabling these commands entirely on mac --- .../electron-browser/webview.contribution.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts b/src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts index 6373b51b11a1..656e0099de6d 100644 --- a/src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts +++ b/src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts @@ -47,15 +47,14 @@ const PRIORITY = 100; function overrideCommandForWebview(command: MultiCommand | undefined, f: (webview: ElectronWebviewBasedWebview) => void) { command?.addImplementation(PRIORITY, accessor => { - if (!isMacintosh || accessor.get(IConfigurationService).getValue('window.titleBarStyle') !== 'native') { - return false; + if (isMacintosh || accessor.get(IConfigurationService).getValue('window.titleBarStyle') === 'native') { + const webview = getActiveElectronBasedWebview(accessor); + if (webview) { + f(webview); + return true; + } } - const webview = getActiveElectronBasedWebview(accessor); - if (webview) { - f(webview); - return true; - } return false; }); }