Skip to content

Commit ab8380f

Browse files
authored
macOS - restore use of hide and show for app.dock second instances (microsoft#259883)
1 parent 2a740e2 commit ab8380f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/vs/code/electron-main/main.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,11 @@ class CodeMain {
313313
throw error;
314314
}
315315

316+
// Since we are the second instance, we do not want to show the dock
317+
if (isMacintosh) {
318+
app.dock?.hide();
319+
}
320+
316321
// there's a running instance, let's connect to it
317322
let client: NodeIPCClient<string>;
318323
try {
@@ -412,6 +417,11 @@ class CodeMain {
412417
throw new ExpectedError('Terminating...');
413418
}
414419

420+
// dock might be hidden at this case due to a retry
421+
if (isMacintosh) {
422+
app.dock?.show();
423+
}
424+
415425
// Set the VSCODE_PID variable here when we are sure we are the first
416426
// instance to startup. Otherwise we would wrongly overwrite the PID
417427
process.env['VSCODE_PID'] = String(process.pid);

0 commit comments

Comments
 (0)