From 050d2ddc49610cfeacc44662fc70a85bfb80d22e Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Thu, 15 Aug 2024 14:13:36 +0200 Subject: [PATCH] IJPL-160020 avoid invokeLater GitOrigin-RevId: 022a73acaa95542aac0be5a0dc31d718ea6a84a2 --- .../src/com/intellij/openapi/wm/impl/ToolWindowImpl.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowImpl.kt b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowImpl.kt index e10e002c93ac..1e1c04121b15 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowImpl.kt +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowImpl.kt @@ -90,7 +90,7 @@ internal class ToolWindowImpl( var windowInfoDuringInit: WindowInfoImpl? = null private val focusTask by lazy { FocusTask(this) } - val focusAlarm: SingleAlarm by lazy { SingleAlarm(focusTask, 0, disposable) } + val focusAlarm: SingleAlarm by lazy { SingleAlarm(focusTask, 0, parentDisposable) } private var stripeShortTitleProvider: Supplier<@NlsContexts.TabTitle String>? = null @@ -166,7 +166,7 @@ internal class ToolWindowImpl( }.cancelOnDispose(disposable) } - private class UpdateBackgroundContentManager() : ContentManagerListener { + private class UpdateBackgroundContentManager : ContentManagerListener { override fun contentAdded(event: ContentManagerEvent) { InternalDecoratorImpl.setBackgroundRecursively(event.content.component, JBUI.CurrentTheme.ToolWindow.background()) } @@ -236,6 +236,7 @@ internal class ToolWindowImpl( toolWindowFocusWatcher = ToolWindowFocusWatcher(toolWindow = this, component = decorator) contentManager.addContentManagerListener(object : ContentManagerListener { override fun selectionChanged(event: ContentManagerEvent) { + @Suppress("DEPRECATION") this@ToolWindowImpl.decorator?.headerToolbar?.updateActionsImmediately() } }) @@ -669,7 +670,6 @@ internal class ToolWindowImpl( } } - @Suppress("DeprecatedCallableAddReplaceWith") @Deprecated("Do not use. Tool window content will be initialized automatically.", level = DeprecationLevel.ERROR) @ApiStatus.ScheduledForRemoval fun ensureContentInitialized() { @@ -700,7 +700,7 @@ internal class ToolWindowImpl( } override fun showContentPopup(inputEvent: InputEvent) { - // called only when tool window is already opened, so, content should be already created + // called only when a tool window is already opened, so, content should be already created ToolWindowContentUi.toggleContentPopup(contentUi!!, contentManager.value) } @@ -884,7 +884,7 @@ internal class ToolWindowImpl( fun requestFocusInToolWindow() { focusTask.resetStartTime() - focusAlarm.cancelAllRequests() + focusAlarm.cancel() focusTask.run() } }