[rdct] IJPL-112 IJPL-217259 ensure ToolWindow content manager is created under correct ClientId

GitOrigin-RevId: 0028008cbbe215ac8b49693a4ce3d486a0e6daa8
This commit is contained in:
Aleksey Pivovarov
2026-02-14 02:11:08 +00:00
committed by intellij-monorepo-bot
parent f93f4a5b32
commit fb247b1b65
@@ -3,6 +3,8 @@
package com.intellij.openapi.wm.impl
import com.intellij.codeWithMe.ClientId
import com.intellij.codeWithMe.ClientId.Companion.withExplicitClientId
import com.intellij.icons.AllIcons
import com.intellij.ide.DataManager
import com.intellij.ide.IdeBundle
@@ -133,6 +135,7 @@ private val LOG = logger<ToolWindowManagerImpl>()
private var isAvailable: Boolean = true,
private var stripeTitleProvider: Supplier<@NlsContexts.TabTitle String>,
) : ToolWindowEx {
private val toolWindowClientId = ClientId.current
private val contentFactory: AtomicReference<ToolWindowFactory?> = AtomicReference(contentFactory)
@JvmField
@@ -185,7 +188,9 @@ private val LOG = logger<ToolWindowManagerImpl>()
private var tabsSplittingAllowed: Boolean = false
private val contentManager = SynchronizedClearableLazy {
val result = createContentManager()
val result = withExplicitClientId(toolWindowClientId) {
createContentManager()
}
if (toolWindowManager.isNewUi) {
result.addContentManagerListener(UpdateBackgroundContentManager())
}