mirror of
https://github.com/microsoft/vscode.git
synced 2026-10-02 05:51:37 +01:00
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
This commit is contained in:
@@ -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<string>('window.titleBarStyle') !== 'native') {
|
||||
return false;
|
||||
if (isMacintosh || accessor.get(IConfigurationService).getValue<string>('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;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user