From 3d382db75d49baf4a40cab957ce2fe429da4eb23 Mon Sep 17 00:00:00 2001 From: "Vassiliy.Kudryashov" Date: Fri, 5 Jul 2019 23:07:10 +0300 Subject: [PATCH] IDEA-194196 Permanent exception IllegalThreadStateException "window with id="SOME_WINDOW_ID" isn't registered Just a workaround to make 'the umbrella bug' less annoying GitOrigin-RevId: 5342cefbb2bdb78996739fbcdc861aacb3903ae6 --- .../src/com/intellij/openapi/wm/impl/ToolWindowImpl.java | 2 +- .../com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowImpl.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowImpl.java index 3fe9b5884d44..970995492afc 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowImpl.java @@ -201,7 +201,7 @@ public final class ToolWindowImpl implements ToolWindowEx, Disposable { @Override public final boolean isVisible() { - return myToolWindowManager.isToolWindowVisible(myId); + return myToolWindowManager.isToolWindowRegistered(myId) && myToolWindowManager.isToolWindowVisible(myId); } @Override diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java index 7953a2f3b4c0..052099a83d62 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java @@ -217,8 +217,10 @@ public class ToolWindowManagerImpl extends ToolWindowManagerEx implements Persis .handleFloating(toolWindowId -> {}) .handleFocusLostOnPinned(toolWindowId -> { List commands = new ArrayList<>(); - deactivateToolWindowImpl(getRegisteredInfoOrLogError(toolWindowId), true, commands); - execute(commands, true); // notify clients that toolwindow is deactivated + if (isToolWindowRegistered(toolWindowId)) { + deactivateToolWindowImpl(getRegisteredInfoOrLogError(toolWindowId), true, commands); + execute(commands, true); // notify clients that toolwindow is deactivated + } }) .handleWindowed(toolWindowId -> {}) .bind(myProject);