From 3caebff71e514ece73b125468881d102e767ee4d Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Thu, 24 Jun 2021 12:23:22 +0900 Subject: [PATCH] chore: bump electron@12.0.12 * Revert "macOS - workaround fullscreen window regression (#125122)" * Fixes https://github.com/microsoft/vscode/issues/125122 * Fixes https://github.com/microsoft/vscode/issues/126016 * Fixes https://github.com/microsoft/vscode/issues/126013 * Fixes https://github.com/microsoft/vscode/issues/122352 * Fixes https://github.com/microsoft/vscode/issues/126321 --- .yarnrc | 2 +- cgmanifest.json | 4 ++-- package.json | 2 +- .../electron-main/windowsStateHandler.ts | 20 +++++-------------- yarn.lock | 8 ++++---- 5 files changed, 13 insertions(+), 23 deletions(-) diff --git a/.yarnrc b/.yarnrc index fc56776cd05f5..fe063bb8248e5 100644 --- a/.yarnrc +++ b/.yarnrc @@ -1,3 +1,3 @@ disturl "https://electronjs.org/headers" -target "12.0.11" +target "12.0.12" runtime "electron" diff --git a/cgmanifest.json b/cgmanifest.json index 79caa87676575..c9f443af91147 100644 --- a/cgmanifest.json +++ b/cgmanifest.json @@ -60,12 +60,12 @@ "git": { "name": "electron", "repositoryUrl": "https://github.com/electron/electron", - "commitHash": "78ce1d975836f8a4cd5ad4692d0e44f97e228d90" + "commitHash": "088bc334f0e469c330bc15078de8c250a4f195fc" } }, "isOnlyProductionDependency": true, "license": "MIT", - "version": "12.0.11" + "version": "12.0.12" }, { "component": { diff --git a/package.json b/package.json index 3f7691ac88413..89e37698812b3 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "cssnano": "^4.1.11", "debounce": "^1.0.0", "deemon": "^1.4.0", - "electron": "12.0.11", + "electron": "12.0.12", "eslint": "6.8.0", "eslint-plugin-jsdoc": "^19.1.0", "event-stream": "3.3.4", diff --git a/src/vs/platform/windows/electron-main/windowsStateHandler.ts b/src/vs/platform/windows/electron-main/windowsStateHandler.ts index b24443601c2e5..1bdadb1261073 100644 --- a/src/vs/platform/windows/electron-main/windowsStateHandler.ts +++ b/src/vs/platform/windows/electron-main/windowsStateHandler.ts @@ -232,11 +232,9 @@ export class WindowsStateHandler extends Disposable { const windowConfig = this.configurationService.getValue('window'); // Window state is not from a previous session: only allow fullscreen if we inherit it or user wants fullscreen - // or to address a Electron issue on macOS (https://github.com/microsoft/vscode/issues/125122) let allowFullscreen: boolean; if (state.hasDefaultState) { - const configAllowsFullScreen = !!(windowConfig?.newWindowDimensions && ['fullscreen', 'inherit', 'offset'].indexOf(windowConfig.newWindowDimensions) >= 0); - allowFullscreen = configAllowsFullScreen || (isMacintosh && windowConfig?.nativeFullScreen !== false); + allowFullscreen = !!(windowConfig?.newWindowDimensions && ['fullscreen', 'inherit', 'offset'].indexOf(windowConfig.newWindowDimensions) >= 0); } // Window state is from a previous session: only allow fullscreen when we got updated or user wants to restore @@ -339,22 +337,14 @@ export class WindowsStateHandler extends Disposable { // Compute x/y based on display bounds // Note: important to use Math.round() because Electron does not seem to be too happy about // display coordinates that are not absolute numbers. - let state: INewWindowState = defaultWindowState(); + let state = defaultWindowState(); state.x = Math.round(displayToUse.bounds.x + (displayToUse.bounds.width / 2) - (state.width! / 2)); state.y = Math.round(displayToUse.bounds.y + (displayToUse.bounds.height / 2) - (state.height! / 2)); + // Check for newWindowDimensions setting and adjust accordingly const windowConfig = this.configurationService.getValue('window'); let ensureNoOverlap = true; - - // TODO@electron macOS: if the current window is fullscreen and native fullscreen - // is not disabled, always open a new window in fullscreen. This is a workaround - // for regression https://github.com/microsoft/vscode/issues/125122 - if (isMacintosh && windowConfig?.nativeFullScreen !== false && lastActive?.isFullScreen) { - state.mode = WindowMode.Fullscreen; - } - - // Adjust according to `newWindowDimensions` user setting - else if (windowConfig?.newWindowDimensions) { + if (windowConfig?.newWindowDimensions) { if (windowConfig.newWindowDimensions === 'maximized') { state.mode = WindowMode.Maximized; ensureNoOverlap = false; @@ -377,7 +367,7 @@ export class WindowsStateHandler extends Disposable { state = this.ensureNoOverlap(state); } - state.hasDefaultState = true; // flag as default state + (state as INewWindowState).hasDefaultState = true; // flag as default state return state; } diff --git a/yarn.lock b/yarn.lock index bb85360078075..734190d9d609d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3039,10 +3039,10 @@ electron-to-chromium@^1.3.723: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.737.tgz#196f2e9656f4f3c31930750e1899c091b72d36b5" integrity sha512-P/B84AgUSQXaum7a8m11HUsYL8tj9h/Pt5f7Hg7Ty6bm5DxlFq+e5+ouHUoNQMsKDJ7u4yGfI8mOErCmSH9wyg== -electron@12.0.11: - version "12.0.11" - resolved "https://registry.yarnpkg.com/electron/-/electron-12.0.11.tgz#555dc1cf663e320f2f2cbdf89319352b08fc59f2" - integrity sha512-6gPjcce3QCeAWZ8UVAqVy6os+86D5BcxgkIzlROxX89u+du/i7WpZXF5F1vgv419rspds9OHejP3JrJnoUGh6w== +electron@12.0.12: + version "12.0.12" + resolved "https://registry.yarnpkg.com/electron/-/electron-12.0.12.tgz#886d1589ebf7fb995d2e2327ef5506d27d58188d" + integrity sha512-6E6dyjuJcGpgJPnsWY7dp1Xhha/NPigNDhxlmdKPwvso8DntFGrGt0SPhi1/wfaWZsXW5wqHBGIP4IN2cZ75WQ== dependencies: "@electron/get" "^1.0.1" "@types/node" "^14.6.2"