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/perspectiveswitcher/PerspectiveSwitcher.java
MUIElement changedElement = (MUIElement) event.getProperty(UIEvents.EventTags.ELEMENT);
			if (psME == null || !(changedElement instanceof MPerspectiveStack))
				return;
			MWindow perspWin = modelService.getTopLevelWindowFor(changedElement);
			MWindow switcherWin = modelService.getTopLevelWindowFor(psME);
			if (perspWin != switcherWin)
				return;
			MPerspectiveStack perspStack = (MPerspectiveStack) changedElement;
			if (!perspStack.isToBeRendered())
				return;
			MPerspective selElement = perspStack.getSelectedElement();
			for (ToolItem ti : psTB.getItems()) {
				ti.setSelection(ti.getData() == selElement);
			}
		}
	};
	private EventHandler toBeRenderedHandler = new EventHandler() {
		public void handleEvent(Event event) {
			if (psTB.isDisposed()) {
				return;
			}
			MUIElement changedElement = (MUIElement) event.getProperty(UIEvents.EventTags.ELEMENT);
			if (psME == null || !(changedElement instanceof MPerspective))
				return;
			MWindow perspWin = modelService.getTopLevelWindowFor(changedElement);
			MWindow switcherWin = modelService.getTopLevelWindowFor(psME);
			if (perspWin != switcherWin)
				return;
			MPerspective persp = (MPerspective) changedElement;
			if (!persp.getParent().isToBeRendered())