[RDCT] GTW-7343: Fix switching focus between project windows

IJ-MR-130153

GitOrigin-RevId: 19d90502bd6bb1737f6e3628887ecf49289c8930
This commit is contained in:
Vyacheslav Moklev
2024-03-28 11:10:18 +00:00
committed by intellij-monorepo-bot
parent d809db3ec4
commit 1f4f9ed7aa
2 changed files with 7 additions and 2 deletions
@@ -217,6 +217,10 @@ open class RecentProjectsManagerBase(coroutineScope: CoroutineScope) :
protected open fun getProjectDisplayName(project: Project): String? = null
protected open fun focusProjectWindow(project: Project) {
ProjectUtil.focusProjectWindow(project = project)
}
fun getProjectIcon(path: String, isProjectValid: Boolean): Icon {
return projectIconHelper.getProjectIcon(path, isProjectValid)
}
@@ -312,7 +316,7 @@ open class RecentProjectsManagerBase(coroutineScope: CoroutineScope) :
projectManager.openProjects.firstOrNull { isSameProject(projectFile = projectFile, project = it) }?.let { project ->
FUSProjectHotStartUpMeasurer.reportAlreadyOpenedProject()
withContext(Dispatchers.EDT) {
ProjectUtil.focusProjectWindow(project = project)
focusProjectWindow(project)
}
return project
}
@@ -2,6 +2,7 @@
package com.intellij.openapi.wm.impl.welcomeScreen.recentProjects
import com.intellij.CommonBundle
import com.intellij.codeWithMe.ClientId
import com.intellij.ide.*
import com.intellij.ide.impl.OpenProjectTask
import com.intellij.ide.lightEdit.LightEdit
@@ -60,7 +61,7 @@ internal data class RecentProjectItem(
companion object {
fun openProjectAndLogRecent(file: Path, options: OpenProjectTask, projectGroup: ProjectGroup?) {
service<CoreUiCoroutineScopeHolder>().coroutineScope.launch {
service<CoreUiCoroutineScopeHolder>().coroutineScope.launch(ClientId.coroutineContext()) {
RecentProjectsManagerBase.getInstanceEx().openProject(file, options)
for (extension in ProjectDetector.EXTENSION_POINT_NAME.extensions) {
extension.logRecentProjectOpened(projectGroup)