From 5057c95e6b5a43ddecee0d6f663764b7c80f6c95 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 11 May 2017 07:54:36 +0200 Subject: [PATCH] some electron deprecation fixes --- build/npm/preinstall.js | 2 +- scripts/npm.bat | 2 +- scripts/npm.sh | 2 +- src/typings/electron.d.ts | 4 ++-- src/vs/workbench/electron-browser/bootstrap/index.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build/npm/preinstall.js b/build/npm/preinstall.js index 6a65998d3f6..8bd27204e35 100644 --- a/build/npm/preinstall.js +++ b/build/npm/preinstall.js @@ -6,7 +6,7 @@ const path = require('path'); const cp = require('child_process'); -if (process.env['npm_config_disturl'] !== 'https://atom.io/download/atom-shell') { +if (process.env['npm_config_disturl'] !== 'https://atom.io/download/electron') { console.error("You can't use plain npm to install Code's dependencies."); console.error( /^win/.test(process.platform) diff --git a/scripts/npm.bat b/scripts/npm.bat index 943404a1078..aeb8e93c90c 100644 --- a/scripts/npm.bat +++ b/scripts/npm.bat @@ -1,7 +1,7 @@ @echo off setlocal -set npm_config_disturl="https://atom.io/download/atom-shell" +set npm_config_disturl="https://atom.io/download/electron" for /f "tokens=2 delims=:, " %%a in ('findstr /R /C:"\"electronVersion\":.*" "%~dp0..\package.json"') do set npm_config_target=%%~a set npm_config_arch="ia32" set npm_config_runtime="electron" diff --git a/scripts/npm.sh b/scripts/npm.sh index b56ec27c7fd..69c6d0c48ae 100755 --- a/scripts/npm.sh +++ b/scripts/npm.sh @@ -22,7 +22,7 @@ ELECTRON_VERSION=$( ELECTRON_GYP_HOME=~/.electron-gyp mkdir -p $ELECTRON_GYP_HOME -npm_config_disturl=https://atom.io/download/atom-shell \ +npm_config_disturl=https://atom.io/download/electron \ npm_config_target=$ELECTRON_VERSION \ npm_config_runtime=electron \ HOME=$ELECTRON_GYP_HOME \ diff --git a/src/typings/electron.d.ts b/src/typings/electron.d.ts index e85bb7d346f..5a1f5ea3430 100644 --- a/src/typings/electron.d.ts +++ b/src/typings/electron.d.ts @@ -4466,7 +4466,7 @@ declare namespace Electron { /** * Sets the maximum and minimum zoom level. */ - setZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; + setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; /** * Executes the editing command undo in web page. */ @@ -5161,7 +5161,7 @@ declare namespace Electron { /** * Sets the maximum and minimum zoom level. */ - setZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; + setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; /** * Sets a provider for spell checking in input fields and text areas. */ diff --git a/src/vs/workbench/electron-browser/bootstrap/index.js b/src/vs/workbench/electron-browser/bootstrap/index.js index f320447cd9a..e886c4a3469 100644 --- a/src/vs/workbench/electron-browser/bootstrap/index.js +++ b/src/vs/workbench/electron-browser/bootstrap/index.js @@ -148,7 +148,7 @@ function main() { // disable pinch zoom & apply zoom level early to avoid glitches const zoomLevel = configuration.zoomLevel; - webFrame.setZoomLevelLimits(1, 1); + webFrame.setVisualZoomLevelLimits(1, 1); if (typeof zoomLevel === 'number' && zoomLevel !== 0) { webFrame.setZoomLevel(zoomLevel); }