From df3c4578ee2de5cfa108ff9a506014cc88348152 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Thu, 21 Nov 2019 20:45:15 +0100 Subject: [PATCH] IDEA-223706 Properties of IDE panels aren't saved GitOrigin-RevId: 65466b01248964617046fe147c87ae06c4139a1d --- .../openapi/wm/impl/ToolWindowManagerImpl.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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 2cd25b9c9a06..532abd55266f 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 @@ -78,7 +78,7 @@ public class ToolWindowManagerImpl extends ToolWindowManagerEx implements Persis private final Project myProject; private final EventDispatcher myDispatcher = EventDispatcher.create(ToolWindowManagerListener.class); - private final DesktopLayout myLayout = new DesktopLayout(); + private DesktopLayout myLayout = new DesktopLayout(); private final Map myId2InternalDecorator = new HashMap<>(); private final Map myId2FloatingDecorator = new HashMap<>(); private final Map myId2WindowedDecorator = new HashMap<>(); @@ -569,6 +569,10 @@ public class ToolWindowManagerImpl extends ToolWindowManagerEx implements Persis * Before delegating it fires state changed. */ private void execute(@NotNull List commandList, boolean isFireStateChangedEvent) { + if (commandList.isEmpty()) { + return; + } + if (isFireStateChangedEvent) { for (FinalizableCommand each : commandList) { if (each.willChangeState()) { @@ -1228,9 +1232,14 @@ public class ToolWindowManagerImpl extends ToolWindowManagerEx implements Persis public void setLayout(@NotNull DesktopLayout layout) { ApplicationManager.getApplication().assertIsDispatchThread(); - List commandList = new ArrayList<>(); // hide tool window that are invisible or its info is not presented in new layout List currentInfos = myLayout.getInfos(); + if (currentInfos.isEmpty()) { + myLayout = layout; + return; + } + + List commandList = new ArrayList<>(); for (WindowInfoImpl currentInfo : currentInfos) { WindowInfoImpl info = layout.getInfo(Objects.requireNonNull(currentInfo.getId()), false); if (currentInfo.isVisible() && (info == null || !info.isVisible())) { @@ -1282,6 +1291,7 @@ public class ToolWindowManagerImpl extends ToolWindowManagerEx implements Persis execute(commandList); checkInvariants(""); + myLayout = layout; } @Override @@ -2367,6 +2377,7 @@ public class ToolWindowManagerImpl extends ToolWindowManagerEx implements Persis if (!ApplicationManager.getApplication().isEAP() && !ApplicationManager.getApplication().isInternal()) { return; } + List violations = new ArrayList<>(); for (WindowInfoImpl info : myLayout.getInfos()) { String id = Objects.requireNonNull(info.getId());