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
updateSelection(null);
				
				Point size = hostPane.getSize();
				toolControl.getPersistedState().put("XSize", Integer.toString(size.x));
				toolControl.getPersistedState().put("YSize", Integer.toString(size.y));
			}
			
			if (ctf != null) {
				ctf.setMinimizeVisible(true);
				ctf.setMaximizeVisible(false);
				ctf.setMaximized(false);
			}
		}
	}
	Composite getShellClientComposite() {
		Shell theShell = trimStackTB.getShell();
		if (!(theShell.getLayout() instanceof TrimmedPartLayout))
			return null;
		TrimmedPartLayout tpl = (TrimmedPartLayout) theShell.getLayout();
		return tpl.clientArea;
	}
	/**
	 * @param showShell2
	 */
	private void setPaneLocation(Composite someShell) {
		Rectangle caRect = getShellClientComposite().getBounds();
		Point paneSize = hostPane.getSize();
		Point loc = new Point(0, 0);
		if (isFixed(SWT.LEFT))