Skip to content

Commit

Permalink
chore: some cleanups from the Electron v25 update
Browse files Browse the repository at this point in the history
  • Loading branch information
deepak1556 committed Aug 8, 2023
1 parent 85daa35 commit 22d7569
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
1 change: 1 addition & 0 deletions build/azure-pipelines/linux/product-build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ steps:
NPM_REGISTRY: "$(NPM_REGISTRY)"
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
VSCODE_SKIP_NODE_VERSION_CHECK: 1
GITHUB_TOKEN: "$(github-distro-mixin-password)"
VSCODE_HOST_MOUNT: "/mnt/vss/_work/1/s"
${{ if or(eq(parameters.VSCODE_ARCH, 'x64'), eq(parameters.VSCODE_ARCH, 'arm64')) }}:
Expand Down
14 changes: 8 additions & 6 deletions build/npm/preinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ const majorNodeVersion = parseInt(nodeVersion[1]);
const minorNodeVersion = parseInt(nodeVersion[2]);
const patchNodeVersion = parseInt(nodeVersion[3]);

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

const path = require('path');
Expand Down
8 changes: 6 additions & 2 deletions src/vs/base/parts/ipc/electron-main/ipcMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@ class ValidatedIpcMain implements Event.NodeEventEmitter {
const sender = event.senderFrame;

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

let host = 'unknown';
Expand Down
6 changes: 5 additions & 1 deletion src/vs/platform/windows/electron-main/windowImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,11 @@ export class CodeWindow extends Disposable implements ICodeWindow {
// macOS: traffic lights
else if (isMacintosh && options.height !== undefined) {
const verticalOffset = (options.height - 15) / 2; // 15px is the height of the traffic lights
this._win.setTrafficLightPosition({ x: verticalOffset, y: verticalOffset });
if (!verticalOffset) {
this._win.setWindowButtonPosition(null);
} else {
this._win.setWindowButtonPosition({ x: verticalOffset, y: verticalOffset });
}
}
}

Expand Down

0 comments on commit 22d7569

Please sign in to comment.