Skip to content

Commit 2b5ac23

Browse files
committed
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
1 parent 1cfd3a1 commit 2b5ac23

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,14 @@ const PRIORITY = 100;
4747

4848
function overrideCommandForWebview(command: MultiCommand | undefined, f: (webview: ElectronWebviewBasedWebview) => void) {
4949
command?.addImplementation(PRIORITY, accessor => {
50-
if (!isMacintosh || accessor.get(IConfigurationService).getValue<string>('window.titleBarStyle') !== 'native') {
51-
return false;
50+
if (isMacintosh || accessor.get(IConfigurationService).getValue<string>('window.titleBarStyle') === 'native') {
51+
const webview = getActiveElectronBasedWebview(accessor);
52+
if (webview) {
53+
f(webview);
54+
return true;
55+
}
5256
}
5357

54-
const webview = getActiveElectronBasedWebview(accessor);
55-
if (webview) {
56-
f(webview);
57-
return true;
58-
}
5958
return false;
6059
});
6160
}

0 commit comments

Comments
 (0)