Bug 318363 [UI] Closing Perspectives changes others
If you open the Debug perspective and then close it the Package Explorer disappears. Root cause was that I opened the second perspective using the perspective switcher which performed the operation 'locally' rather than going through the WorkbenchPage#setPerspective code. This meant that the 'openPerspectives' list wasn't updated which meant that the 'closePerspective' call delegated to 'closeAllPerspectives' since it thought there was only one open.
bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java
String ySizeStr = toolControl.getPersistedState().get("YSize");
		if (ySizeStr != null)
			ySize = Integer.parseInt(ySizeStr);
		hostPane.setSize(xSize, ySize);
		hostPane.addListener(SWT.Traverse, escapeListener);
		
		fixedSides = getFixedSides();
		hostPane.setLayout(new TrimPaneLayout(fixedSides));
		return hostPane;
	}
	private int getFixedSides() {
		int verticalValue = SWT.TOP; 
		if (bar.getSide() == SideValue.LEFT)
			return SWT.LEFT | verticalValue;
		else if (bar.getSide() == SideValue.RIGHT)
			return SWT.RIGHT | verticalValue;
		return SWT.TOP | SWT.LEFT;
	}
	private Image getRestoreImage(Display display) {
		if (restoreImage == null) {
			restoreImage = WorkbenchImages
					.getImage(IWorkbenchGraphicConstants.IMG_ETOOL_RESTORE_TRIMPART);
		}
		return restoreImage;
	}
	private boolean isFixed(int swtSide) {
		return (fixedSides & swtSide) != 0;
	}
}