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
trimStackTB.getShell().layout(new Control[] { trimStackTB }, SWT.DEFER);
	}
	void restoreStack() {
		showStack(false);
		theStack.setVisible(true);
		toolControl.setVisible(false);
	}
	@Execute
	public void showStack(@Named("show") boolean show) {
		CTabFolder ctf = (CTabFolder) theStack.getWidget();
		if (show) {
			hostPane = getHostPane();
			ctf.setParent(hostPane);
			hostPane.getDisplay().addFilter(SWT.MouseDown, mouseDownListener);
			getShellClientComposite().addControlListener(caResizeListener);
			
			ctf.setMinimizeVisible(false);
			ctf.setMaximizeVisible(true);
			ctf.setMaximized(true);
			updateSelection(theStack.getSelectedElement());
			
			setPaneLocation(hostPane);
			hostPane.layout(true);
			hostPane.moveAbove(null);
			hostPane.setVisible(true);
		} else {
			Display.getCurrent().removeFilter(SWT.MouseDown, mouseDownListener);
			getShellClientComposite().removeControlListener(caResizeListener);
			if (hostPane != null && hostPane.isVisible()) {
				hostPane.setVisible(false);