From dd68286c5f88c5a124049e0bcd7562e7d40c6a20 Mon Sep 17 00:00:00 2001 From: Juan Campa Date: Tue, 25 Dec 2018 21:15:25 -0500 Subject: [PATCH] Upgrade Electron to v4 (#3329) * Bumping electron to 3.0.10 * Updating node version in travis and appveyor * Fixing incorrect require of electron-fetch * Fix zoom to match previous versions Additionally I'm removing a call to disable pinch-zoom, it's disable by default since Electron 2 (https://electronjs.org/releases#2.0.0) * Bumping electron to 4.0.0-beta.8 * Bumping electron to 4.0.0-beta.9 * Work around for Copy accelerator not firing on electron v4 * Fixing header/titlebar in MacOS * Upgrading to electron 4.0.0 and node-pty 0.8.0 * Adding yarn.lock changes for electron 4.0.0 * Adding comments for editor:copy workaround. Scaling issue is only on Linux * Upgrading node-abi to support electron 4.0.0 * popup now takes an object as input --- .travis.yml | 2 +- app/auto-updater-linux.js | 2 +- app/commands.js | 10 + app/index.html | 1 + app/notifications.js | 2 +- app/package.json | 8 +- app/ui/window.js | 4 +- app/yarn.lock | 37 +- appveyor.yml | 2 +- lib/index.js | 7 +- package.json | 10 +- yarn.lock | 1078 ++++++++++++++++++++++++++----------- 12 files changed, 807 insertions(+), 356 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9d70f7e5..623c09fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ language: node_js matrix: include: - os: linux - node_js: 8 + node_js: 10.11.0 env: CC=clang CXX=clang++ npm_config_clang=1 compiler: clang diff --git a/app/auto-updater-linux.js b/app/auto-updater-linux.js index 31dd23d8..1257c206 100644 --- a/app/auto-updater-linux.js +++ b/app/auto-updater-linux.js @@ -1,6 +1,6 @@ 'use strict'; -const fetch = require('electron-fetch'); +const fetch = require('electron-fetch').default; const {EventEmitter} = require('events'); class AutoUpdater extends EventEmitter { diff --git a/app/commands.js b/app/commands.js index 498573cb..63f20dd8 100644 --- a/app/commands.js +++ b/app/commands.js @@ -53,6 +53,16 @@ const commands = { webContents.openDevTools({mode: 'detach'}); } }, + 'editor:copy': focusedWindow => { + // HACK: Had to add this because the "editor:copy" role is not firing with + // ctrl+shift+c after upgrading to electron 4 + // Electron issue: https://github.com/electron/electron#16088 + if (!focusedWindow) { + return; + } + const webContents = focusedWindow.webContents; + webContents.copy(); + }, 'zoom:reset': focusedWindow => { focusedWindow && focusedWindow.rpc.emit('reset fontSize req'); }, diff --git a/app/index.html b/app/index.html index 04a2a4fa..3d16602e 100644 --- a/app/index.html +++ b/app/index.html @@ -5,6 +5,7 @@ +