From 46e453dc1cf18b58d986bee46db181544792d78e Mon Sep 17 00:00:00 2001 From: isidor Date: Mon, 3 Dec 2018 12:05:05 +0100 Subject: [PATCH] zen mode: We will not restore zen mode, need to clear all zen mode state changes --- src/vs/workbench/electron-browser/workbench.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index 5a0672cf215..fc7b860aa7c 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -72,7 +72,7 @@ import { ProgressService2 } from 'vs/workbench/services/progress/browser/progres import { TextModelResolverService } from 'vs/workbench/services/textmodelResolver/common/textModelResolverService'; import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { LifecyclePhase, StartupKind } from 'vs/platform/lifecycle/common/lifecycle'; +import { LifecyclePhase, StartupKind, ShutdownReason } from 'vs/platform/lifecycle/common/lifecycle'; import { LifecycleService } from 'vs/platform/lifecycle/electron-browser/lifecycleService'; import { IWindowService, IWindowConfiguration, IPath, MenuBarVisibility, getTitleBarStyle } from 'vs/platform/windows/common/windows'; import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar'; @@ -500,6 +500,15 @@ export class Workbench extends Disposable implements IPartService { // Group changes this._register(this.editorGroupService.onDidAddGroup(() => this.centerEditorLayout(this.shouldCenterLayout))); this._register(this.editorGroupService.onDidRemoveGroup(() => this.centerEditorLayout(this.shouldCenterLayout))); + + this._register(this.lifecycleService.onWillShutdown(e => { + const zenConfig = this.configurationService.getValue('zenMode'); + const willRestoreZenMode = this.zenMode.active && (zenConfig.restore || e.reason === ShutdownReason.RELOAD); + if (!willRestoreZenMode) { + // We will not restore zen mode, need to clear all zen mode state changes + this.toggleZenMode(true); + } + })); } private onFullscreenChanged(): void { -- GitLab