Skip to content

Commit

Permalink
chore: bump electron@12.0.12
Browse files Browse the repository at this point in the history
* Revert "macOS - workaround fullscreen window regression (#125122)"
* Fixes #125122
* Fixes #126016
* Fixes #126013
* Fixes #122352
* Fixes #126321
  • Loading branch information
deepak1556 committed Jun 24, 2021
1 parent a3fc50b commit 3caebff
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .yarnrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
disturl "https://electronjs.org/headers"
target "12.0.11"
target "12.0.12"
runtime "electron"
4 changes: 2 additions & 2 deletions cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
20 changes: 5 additions & 15 deletions src/vs/platform/windows/electron-main/windowsStateHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,9 @@ export class WindowsStateHandler extends Disposable {
const windowConfig = this.configurationService.getValue<IWindowSettings | undefined>('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
Expand Down Expand Up @@ -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<IWindowSettings | undefined>('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;
Expand All @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 3caebff

Please sign in to comment.