Skip to content

Commit 22d7569

Browse files
committed
chore: some cleanups from the Electron v25 update
1 parent 85daa35 commit 22d7569

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

build/azure-pipelines/linux/product-build-linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ steps:
138138
NPM_REGISTRY: "$(NPM_REGISTRY)"
139139
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
140140
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
141+
VSCODE_SKIP_NODE_VERSION_CHECK: 1
141142
GITHUB_TOKEN: "$(github-distro-mixin-password)"
142143
VSCODE_HOST_MOUNT: "/mnt/vss/_work/1/s"
143144
${{ if or(eq(parameters.VSCODE_ARCH, 'x64'), eq(parameters.VSCODE_ARCH, 'arm64')) }}:

build/npm/preinstall.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ const majorNodeVersion = parseInt(nodeVersion[1]);
99
const minorNodeVersion = parseInt(nodeVersion[2]);
1010
const patchNodeVersion = parseInt(nodeVersion[3]);
1111

12-
if (majorNodeVersion < 18 || (majorNodeVersion === 18 && minorNodeVersion < 15)) {
13-
console.error('\033[1;31m*** Please use node.js versions >=18.15.x and <19.\033[0;0m');
14-
// err = true; enable once update unit test docker images are updated #189885
15-
}
16-
if (majorNodeVersion >= 19) {
17-
console.warn('\033[1;31m*** Warning: Versions of node.js >= 19 have not been tested.\033[0;0m')
12+
if (!process.env['VSCODE_SKIP_NODE_VERSION_CHECK']) {
13+
if (majorNodeVersion < 18 || (majorNodeVersion === 18 && minorNodeVersion < 15)) {
14+
console.error('\033[1;31m*** Please use node.js versions >=18.15.x and <19.\033[0;0m');
15+
err = true;
16+
}
17+
if (majorNodeVersion >= 19) {
18+
console.warn('\033[1;31m*** Warning: Versions of node.js >= 19 have not been tested.\033[0;0m')
19+
}
1820
}
1921

2022
const path = require('path');

src/vs/base/parts/ipc/electron-main/ipcMain.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,12 @@ class ValidatedIpcMain implements Event.NodeEventEmitter {
111111
const sender = event.senderFrame;
112112

113113
const url = sender.url;
114-
if (!url) {
115-
return true; // TODO@electron this only seems to happen from playwright runs (https://github.com/microsoft/vscode/issues/147301)
114+
// `url` can be `undefined` when running tests from playwright https://github.com/microsoft/vscode/issues/147301
115+
// and `url` can be `about:blank` when reloading the window
116+
// from performance tab of devtools. It is fine to skip the checks
117+
// in these cases.
118+
if (!url || url === 'about:blank') {
119+
return true;
116120
}
117121

118122
let host = 'unknown';

src/vs/platform/windows/electron-main/windowImpl.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,11 @@ export class CodeWindow extends Disposable implements ICodeWindow {
11061106
// macOS: traffic lights
11071107
else if (isMacintosh && options.height !== undefined) {
11081108
const verticalOffset = (options.height - 15) / 2; // 15px is the height of the traffic lights
1109-
this._win.setTrafficLightPosition({ x: verticalOffset, y: verticalOffset });
1109+
if (!verticalOffset) {
1110+
this._win.setWindowButtonPosition(null);
1111+
} else {
1112+
this._win.setWindowButtonPosition({ x: verticalOffset, y: verticalOffset });
1113+
}
11101114
}
11111115
}
11121116

0 commit comments

Comments
 (0)