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
This commit is contained in:
Vassiliy.Kudryashov
2019-07-05 23:46:57 +03:00
committed by intellij-monorepo-bot
parent 954e09c96a
commit 3d382db75d
2 changed files with 5 additions and 3 deletions
@@ -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
@@ -217,8 +217,10 @@ public class ToolWindowManagerImpl extends ToolWindowManagerEx implements Persis
.handleFloating(toolWindowId -> {})
.handleFocusLostOnPinned(toolWindowId -> {
List<FinalizableCommand> 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);