Skip to content

Commit fe669b9

Browse files
authored
Fix conditional for overrideCommandForWebview (microsoft#102410)
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 d511693 commit fe669b9

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
@@ -54,15 +54,14 @@ const PRIORITY = 100;
5454

5555
function overrideCommandForWebview(command: MultiCommand | undefined, f: (webview: ElectronWebviewBasedWebview) => void) {
5656
command?.addImplementation(PRIORITY, accessor => {
57-
if (!isMacintosh || accessor.get(IConfigurationService).getValue<string>('window.titleBarStyle') !== 'native') {
58-
return false;
57+
if (isMacintosh || accessor.get(IConfigurationService).getValue<string>('window.titleBarStyle') === 'native') {
58+
const webview = getActiveElectronBasedWebview(accessor);
59+
if (webview) {
60+
f(webview);
61+
return true;
62+
}
5963
}
6064

61-
const webview = getActiveElectronBasedWebview(accessor);
62-
if (webview) {
63-
f(webview);
64-
return true;
65-
}
6665
return false;
6766
});
6867
}

0 commit comments

Comments
 (0)