Merge from vscode e3c4990c67c40213af168300d1cfeb71d680f877 (#16569)

This commit is contained in:
Cory Rivera
2021-08-25 16:28:29 -07:00
committed by GitHub
parent ab1112bfb3
commit cb7b7da0a4
1752 changed files with 59525 additions and 33878 deletions

View File

@@ -58,6 +58,7 @@ export interface IssueReporterData extends WindowData {
issueType?: IssueType;
extensionId?: string;
experiments?: string;
restrictedMode: boolean;
githubAccessToken: string;
readonly issueTitle?: string;
readonly issueBody?: string;
@@ -70,8 +71,14 @@ export interface ISettingSearchResult {
}
export interface ProcessExplorerStyles extends WindowStyles {
hoverBackground?: string;
hoverForeground?: string;
listHoverBackground?: string;
listHoverForeground?: string;
listFocusBackground?: string;
listFocusForeground?: string;
listFocusOutline?: string;
listActiveSelectionBackground?: string;
listActiveSelectionForeground?: string;
listHoverOutline?: string;
}
export interface ProcessExplorerData extends WindowData {

View File

@@ -25,6 +25,13 @@ import { DisposableStore } from 'vs/base/common/lifecycle';
export const IIssueMainService = createDecorator<IIssueMainService>('issueMainService');
interface IBrowserWindowOptions {
backgroundColor: string | undefined;
title: string;
zoomLevel: number;
alwaysOnTop: boolean;
}
export interface IIssueMainService extends ICommonIssueService { }
export class IssueMainService implements ICommonIssueService {
@@ -189,7 +196,12 @@ export class IssueMainService implements ICommonIssueService {
const issueReporterWindowConfigUrl = issueReporterDisposables.add(this.protocolMainService.createIPCObjectUrl<IssueReporterWindowConfiguration>());
const position = this.getWindowPosition(this.issueReporterParentWindow, 700, 800);
this.issueReporterWindow = this.createBrowserWindow(position, issueReporterWindowConfigUrl, data.styles.backgroundColor, localize('issueReporter', "Issue Reporter"), data.zoomLevel);
this.issueReporterWindow = this.createBrowserWindow(position, issueReporterWindowConfigUrl, {
backgroundColor: data.styles.backgroundColor,
title: localize('issueReporter', "Issue Reporter"),
zoomLevel: data.zoomLevel,
alwaysOnTop: false
});
// Store into config object URL
issueReporterWindowConfigUrl.update({
@@ -239,7 +251,12 @@ export class IssueMainService implements ICommonIssueService {
const processExplorerWindowConfigUrl = processExplorerDisposables.add(this.protocolMainService.createIPCObjectUrl<ProcessExplorerWindowConfiguration>());
const position = this.getWindowPosition(this.processExplorerParentWindow, 800, 500);
this.processExplorerWindow = this.createBrowserWindow(position, processExplorerWindowConfigUrl, data.styles.backgroundColor, localize('processExplorer', "Process Explorer"), data.zoomLevel);
this.processExplorerWindow = this.createBrowserWindow(position, processExplorerWindowConfigUrl, {
backgroundColor: data.styles.backgroundColor,
title: localize('processExplorer', "Process Explorer"),
zoomLevel: data.zoomLevel,
alwaysOnTop: true
});
// Store into config object URL
processExplorerWindowConfigUrl.update({
@@ -273,7 +290,7 @@ export class IssueMainService implements ICommonIssueService {
this.processExplorerWindow?.focus();
}
private createBrowserWindow<T>(position: IWindowState, ipcObjectUrl: IIPCObjectUrl<T>, backgroundColor: string | undefined, title: string, zoomLevel: number): BrowserWindow {
private createBrowserWindow<T>(position: IWindowState, ipcObjectUrl: IIPCObjectUrl<T>, options: IBrowserWindowOptions): BrowserWindow {
const window = new BrowserWindow({
fullscreen: false,
skipTaskbar: true,
@@ -284,20 +301,20 @@ export class IssueMainService implements ICommonIssueService {
minHeight: 200,
x: position.x,
y: position.y,
title,
backgroundColor: backgroundColor || IssueMainService.DEFAULT_BACKGROUND_COLOR,
title: options.title,
backgroundColor: options.backgroundColor || IssueMainService.DEFAULT_BACKGROUND_COLOR,
webPreferences: {
preload: FileAccess.asFileUri('vs/base/parts/sandbox/electron-browser/preload.js', require).fsPath,
additionalArguments: [`--vscode-window-config=${ipcObjectUrl.resource.toString()}`, '--context-isolation' /* TODO@bpasero: Use process.contextIsolateed when 13-x-y is adopted (https://github.com/electron/electron/pull/28030) */],
v8CacheOptions: browserCodeLoadingCacheStrategy,
enableWebSQL: false,
enableRemoteModule: false,
spellcheck: false,
nativeWindowOpen: true,
zoomFactor: zoomLevelToZoomFactor(zoomLevel),
zoomFactor: zoomLevelToZoomFactor(options.zoomLevel),
sandbox: true,
contextIsolation: true
}
contextIsolation: true,
},
alwaysOnTop: options.alwaysOnTop
});
window.setMenuBarVisibility(false);