Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #13905: Set relaunch command for window #15407

Merged
merged 3 commits into from Apr 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/typings/electron.d.ts
Expand Up @@ -1318,6 +1318,18 @@ declare namespace Electron {
* Note: This API is available only on Windows.
*/
setThumbnailToolTip(toolTip: string): boolean;
/**
* Sets the application id, app icon, relaunch command and relaunch display name
* for the given window. appIconIndex should be set to 0 if the app icon
* file only has a single icon.
*/
setAppDetails(options: {
appId?: string;
appIconPath?: string;
appIconIndex?: number;
relaunchCommand?: string;
relaunchDisplayName?: string;
}): void;
/**
* Same as webContents.showDefinitionForSelection().
* Note: This API is available only on macOS.
Expand Down
11 changes: 10 additions & 1 deletion src/vs/code/electron-main/window.ts
Expand Up @@ -219,6 +219,15 @@ export class VSCodeWindow {
this._win.setSheetOffset(22); // offset dialogs by the height of the custom title bar if we have any
}

// Set relaunch command
if (platform.isWindows && product.win32AppUserModelId && typeof this._win.setAppDetails === 'function') {
this._win.setAppDetails({
appId: product.win32AppUserModelId,
relaunchCommand: `"${process.execPath}" -n`,
relaunchDisplayName: product.nameLong
});
}

if (isFullscreenOrMaximized) {
this.win.maximize();

Expand Down Expand Up @@ -769,4 +778,4 @@ export class VSCodeWindow {

this._win = null; // Important to dereference the window object to allow for GC
}
}
}