diff --git a/platform/platform-impl/src/com/intellij/ide/RecentProjectMetaInfo.kt b/platform/platform-impl/src/com/intellij/ide/RecentProjectMetaInfo.kt index 663c47e981d5..166c6712567a 100644 --- a/platform/platform-impl/src/com/intellij/ide/RecentProjectMetaInfo.kt +++ b/platform/platform-impl/src/com/intellij/ide/RecentProjectMetaInfo.kt @@ -65,4 +65,6 @@ class RecentProjectManagerState : BaseState() { var lastProjectLocation by string() var lastOpenedProject by string() + + var forceReopenProjects by property(false) } \ No newline at end of file diff --git a/platform/platform-impl/src/com/intellij/ide/RecentProjectsManagerBase.kt b/platform/platform-impl/src/com/intellij/ide/RecentProjectsManagerBase.kt index 7c7650bcabbe..03679dd7b027 100644 --- a/platform/platform-impl/src/com/intellij/ide/RecentProjectsManagerBase.kt +++ b/platform/platform-impl/src/com/intellij/ide/RecentProjectsManagerBase.kt @@ -432,10 +432,15 @@ open class RecentProjectsManagerBase(coroutineScope: CoroutineScope) : return if (path.endsWith(".ipr")) FileUtilRt.getNameWithoutExtension(name) else name } + fun forceReopenProjects() { + state.forceReopenProjects = true + } + override fun willReopenProjectOnStart(): Boolean { - if (!GeneralSettings.getInstance().isReopenLastProject || AppMode.isDontReopenProjects()) { + if (!state.forceReopenProjects && (!GeneralSettings.getInstance().isReopenLastProject || AppMode.isDontReopenProjects())) { return false } + state.forceReopenProjects = false synchronized(stateLock) { return state.additionalInfo.values.any { canReopenProject(it) } diff --git a/platform/smart-update/src/com/intellij/smartUpdate/IdeUpdateStep.kt b/platform/smart-update/src/com/intellij/smartUpdate/IdeUpdateStep.kt index 40a7ac5d5211..ca8f804b125c 100644 --- a/platform/smart-update/src/com/intellij/smartUpdate/IdeUpdateStep.kt +++ b/platform/smart-update/src/com/intellij/smartUpdate/IdeUpdateStep.kt @@ -1,5 +1,6 @@ package com.intellij.smartUpdate +import com.intellij.ide.RecentProjectsManagerBase import com.intellij.ide.util.PropertiesComponent import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.components.service @@ -37,6 +38,7 @@ class IdeRestartStep: SmartUpdateStep { override fun performUpdateStep(project: Project, e: AnActionEvent?, onSuccess: () -> Unit) { val updateAction = getUpdateAction() if (updateAction != null && e != null && updateAction.isRestartRequired) { + RecentProjectsManagerBase.getInstanceEx().forceReopenProjects() PropertiesComponent.getInstance().setValue(IDE_RESTARTED_KEY, true) updateAction.actionPerformed(e) }