src/vs/workbench/browser/parts/activitybar/activitybarActions.ts/MenuActivityActionViewItem/showContextMenu
class MenuActivityActionViewItem:	private async showContextMenu(e?: MouseEvent): Promise<void> {
		const disposables = new DisposableStore();

		let actions: IAction[];
		if (e?.button !== 2) {
			const menu = disposables.add(this.menuService.createMenu(this.menuId, this.contextKeyService));
			actions = await this.resolveMainMenuActions(menu, disposables);
		} else {
			actions = await this.resolveContextMenuActions(disposables);
		}

		const isUsingCustomMenu = isWeb || (getTitleBarStyle(this.configurationService) !== 'native' && !isMacintosh); // see #40262
		const position = this.configurationService.getValue('workbench.sideBar.location');

		this.contextMenuService.showContextMenu({
			getAnchor: () => isUsingCustomMenu ? this.container : e || this.container,
			anchorAlignment: isUsingCustomMenu ? (position === 'left' ? AnchorAlignment.RIGHT : AnchorAlignment.LEFT) : undefined,
			anchorAxisAlignment: isUsingCustomMenu ? AnchorAxisAlignment.HORIZONTAL : AnchorAxisAlignment.VERTICAL,
			getActions: () => actions,
			onHide: () => disposables.dispose()
		});
	}